[jboss-user] [JBoss Seam] - Re: getting the id of the object inserted...
david.spark
do-not-reply at jboss.com
Mon Oct 22 04:03:29 EDT 2007
If you use entityManager.merge(pojo) then it returns the persisted Pojo object from which you can get the ID.
So, for example, you can do
Pojo pojo = new Pojo();
| //Fill pojo with info....
| Pojo pojo2 = entityManager.merge(pojo);
| pojo2.getId(); //There it is....
Actual code might need to be more robust :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097351#4097351
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097351
More information about the jboss-user
mailing list