Top  Previous  Next

An EntityManager will be generated for you if you define the catalog and dataSourceName attributes in the root schema element. The EntityManager can be used to insert, update and delete domain objects into a relational database (the EntityManager assumes that those domain objects actually model the appropriate tables from the catalog). The following code snippet shows how to use the EntityManager in a transaction-oriented way.



    final EntityManager manager = ObjectFactory.getEntityManager();
    final EntityManagerTransaction transaction = manager.beginTransaction(90);



Similarly, if you just wanted to insert the 3 domain objects you could use the convenience method on the EntityManager.