The object / relational mapping, ie the relationship between Java entities and tables of database entries is performed by entity classes themselves, so files are not required XML descriptors. Transactions can also be defined as annotations JPA. The following line of code shows a persistent and managed entity.
Person person = new Person ();
(...) persona.set
entityManager.persist (person)
When metodopersist () is called, the persistence engine will check for the existence of the object with the help of its unique identifier (usually represented in the form of primary key). If a duplicate object is found, it will launch a RuntimeException, EntityExistsException.
Bookmarks