| Author |
hibernate to JPA: generator class=increment
|
David Balažic
Ranch Hand
Joined: May 15, 2008
Posts: 83
|
|
Hi!
Can the following mapping be migrated from hibernate to JPA?
That is with minimum other changes?
Currently I try
But it gives this error when trying to persis an object:
Regards,
David
|
 |
Prabhat Jha
Ranch Hand
Joined: Aug 13, 2007
Posts: 58
|
|
Add how the value will be generated.
Like
|
Thanks,
Prabhat
SCJP 1.5, SCWCD 1.5, SCBCD 1.5
|
 |
David Balažic
Ranch Hand
Joined: May 15, 2008
Posts: 83
|
|
|
GenerationType has no value for "increment".
|
 |
Prabhat Jha
Ranch Hand
Joined: Aug 13, 2007
Posts: 58
|
|
|
I am not sure i got what you meant? Can you elaborate please ?
|
 |
David Balažic
Ranch Hand
Joined: May 15, 2008
Posts: 83
|
|
I guess I did not understand you.
What did you mean by "Add how the value will be generated. " ?
In old project it was created automatically by hibernate.
How to have the same with JPA?
|
 |
David Balažic
Ranch Hand
Joined: May 15, 2008
Posts: 83
|
|
David Balažic wrote:Hi!
Can the following mapping be migrated from hibernate to JPA?
OK, a coworker found the solution:
In case anyone else asks the same question...
Regards,
David
|
 |
Michael Knoke
Greenhorn
Joined: Feb 08, 2010
Posts: 1
|
|
Thanks for the solution. However, I note that going this way requires me to add the import for GenericGenerator which is: org.hibernate.annotations.GenericGenerator
I was always taught that if I was using just JPA then I would never see a "org.hibernate" import; is this just wrong?
|
 |
 |
|
|
subject: hibernate to JPA: generator class=increment
|
|
|