How to obtain sequence value? [message #1085727] |
Tue, 13 August 2013 05:23  |
Eclipse User |
|
|
|
Hello there.
I have a project on EclipseLink + Weld + RestEasy all work in JBoss AS7. I use JTA and I don't know how to properly obtain a sequence value to return it to client. I have an AppSession entity object with a primary key id annotated with @TableGenerator. When I persist that object the Id is 0, although it has a value greater than 0 in MySQL table. I would prefer to generate a sequence value and keep it in a local variable, set it to the id field and then return it to client. Is it possible? What is the best practice to work with sequence values with JTA transactions?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04218 seconds