persist(entity) - JPA EntityManager's method
Method javax.persistence.EntityManager
void persist(
Object entity
)
Make an instance managed and persistent.
- Parameters:
-
entity
- entity instance
- Throws:
- EntityExistsException - if the entity already exists. (If the entity already exists, the
EntityExistsException
may be thrown when the persist operation is invoked, or theEntityExistsException
or anotherPersistenceException
may be thrown at flush or commit time.)IllegalArgumentException
- if the instance is not an entity- TransactionRequiredException - if invoked on a container-managed entity manager of type
PersistenceContextType.TRANSACTION
and there is no transaction
- Since:
- JPA 1.0