Ketan,
To create a new entity you can use that entity's constructor:
Person p = new Person(x, y, z);
To make any entity persistence, you'll just call em.persist(e). If all entities are not related, you can pass an EM instance into the constructor to call persist(). Otherwise, it's better to create all related entities, set the relationships, and then call a single persist() on the root entity (assuming that all CASCADE flags are set correctly).
Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=217518