Oh, and one other thing.  The entity manager will only flush changes that you 
made to attached POJO entities.  You can't just do "new MyEntity()" and expect 
the entity manager to do anything with it.  You must do either em.persist() to 
attach it as a new entity, an em.find() to load an existing entity into the 
entity manager session or something similar to load an existing entity into 
session (like execute a query).

em.merge() will, by definition, act as a em.persist() if the object you are 
merging isn't attached and is a new entity that does not yet exist in the DB.

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

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

Reply via email to