Register / Login
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
Object Relational Mapping
@GeneratedValue(strategy = GenerationType.AUTO)
posted 7 years ago
I have a tiny question ....
I have Primary Key Field (ID) in a normal entity bean
and in the MySQL DB, I put auto increment on the Primary Key (ID) column .....
all looks great .... but there's a problem I can't get the ID from the persisted entity in the same transaction !!!
I put @GeneratedValue(strategy = GenerationType.AUTO) ....
I tried to put it but I got an exception indicating that there's is no 'schema-name.sequence' I don't know what is wrong .... why it's requiring 'schema-name.sequence' !!!
or there's another way to do that ?
am I missing something should I remove
SCJP 5.0, SCWCD 1.4, SCBCD 3.0 with 100 score
rocket mass heater
Boost this thread!
How to assign primary key
JPA, MySQL and @GeneratedValue
Hibernate Annotations for Primary Key
OpenJPA Foreign Key
inheritance and schema creation using JPA annotations