Skip to content

simasch/spring-data-jpa-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Data JPA

Problem

Have you ever wondered why Hibernate sometimes executes a select statement before the insert?

This happens when the Id is assigned by the program and not generated by Hibernate and @Version is not used. See Person

Solutions

To avoid this select statement there are two solutions:

  1. Either use @GeneratedValue as in PersonWithGeneratedId

  2. or if you want to assign the Id you must use @Version as in PersonWithVersion

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages