Question: So I am calling the save method of my repository.

```
//Store Controller
private StoreService;

Store s = new Store();
s.setName("some store");
storeService.createStore(s);

```

--

```
//StoreServiceImpl
private StoreRepository storeRepository;

public void createStore(Store s) {
    storeRepository.save(s);
}

```

when I look at the hibernate logs, a select is generated. What gives?

EDIT #1

It's oracle DB. The id is generated through java and I am just setting it like so:

```
String id = RandomStringGenerator.generate();
s.setId(id);

```

Answer: 
I've figured it out. I needed to create a jpaTransactionManager and set my entityManager within it. Then, I needed to wrap the jpaTransactionManager in a TransactionProxyFactoryBean. Then I needed to create my StoreService bean in the xml as a proxy to TransactionProxyFactoryBean. After that, all calls to save went through the transaction.

In short, I wasn't using transactions when I tried to save it to the database earlier.
Because your `Store` ids are assigned,thus Hibernate has no idea if a given `id` value exists yet in the database.

So by default it checks (*execute* `SELECT` *statement*) against the database to see If this `Store` already exists into database or not and then fire `INSERT` statement.