Home Spring GeneratedValue annotation usage
Reply: 1

Spring GeneratedValue annotation usage

webpersistence Published in 2017-12-06 14:15:59Z

Let's say that I have a Car entity:

public class Car {
      private Integer id;

How does spring know what value to autoincrement when I add a new object to the database?

Adnin Reply to 2017-12-06 14:20:09Z

There is good explanation of primary keys generation strategies: https://www.thoughts-on-java.org/jpa-generate-primary-keys/

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.352981 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO