I'm having a similar problem - using MySQL as the backend (not that I think it 
matters) and just the default @GeneratedValue option.

I've seen references in other sites that imply that if you use a generated 
value, the Id will be updated as soon as you call persist().  In our case, 
before calling persist() it is null (correct), but after calling persist() its 
always zero.

I've tried doing a refresh() afterwards, but that doesn't seem to make a 
difference either.

To avoid the questions, we're trying to get the Id of a newly created (and 
inserted) object so that we can push that Id into Session state.  Seems simple 
enough, right?

-Richard

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084153#4084153

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084153
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to