3
I have a system in JEE7 with Hibernate and Postgresql database, the tables are with auto ID generation by Hibernate:
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
What happens is that Hibernate generates a unique index for all tables, for example, an id=657 for Client and the next id=658 for Product, .....
How it would be possible to generate an index, automatically, for each table?
Thank you.
This way Hibernate will "take care of everything", create the field and auto increment? I will not need to create a Sequence in Postgresql?
– Ozelo
Actually Postgre will take care of everything. The guy
serial
is equivalent to the use of a sequence (but much more succinct).– Anthony Accioly