About EntityManager

101-110 of 200Refresh
JPA Doc
6

javax.persistence.EntityManagerFactory

: IllegalStateException - if the entity manager factory has been closed Since: JPA 1.0 EntityManager createEntityManager() Create a new application-managed EntityManager. Create a new application-managed EntityManager. This method returns a new EntityManager instance each time it is invoked. The isOpen
Forum
5

Is it possible to remove parent/child entities without refresh?

We have a big entity object tree in our project. If I use the entityManager.remove(childEntity) method to remove a child entity a entityManager.refresh(parentEntity) is necessary in order to have an updated parent/child object tree in memory. But entityManager.refresh is too slow for our project
JPA Doc
4

javax.persistence.OptimisticLockException

, if one is active, will be marked for rollback. Since: JPA 1.0 See Also: EntityManager.find(Class, Object, LockModeType) EntityManager.find(Class, Object, LockModeType, java.util.Map) EntityManager.lock(Object, LockModeType) EntityManager.lock(Object, LockModeType, java.util.Map
JPA Doc
4

createEntityManager()

Method javax.persistence.EntityManagerFactory EntityManager createEntityManager() Create a new application-managed EntityManager. This method returns a new EntityManager instance each time it is invoked. The isOpen method will return true on the returned instance. Returns: entity manager instance
JPA Doc
4

createEntityManager(map)

Method javax.persistence.EntityManagerFactory EntityManager createEntityManager(   Map map ) Create a new application-managed EntityManager with the specified Map of properties. This method returns a new EntityManager instance each time it is invoked. The isOpen method will return true
JPA Doc
4

javax.persistence.NamedQuery

EntityManager em; ... customers = em.createNamedQuery("findAllCustomersWithName ... with the EntityManager methods that create query objects. (Required) The name used to refer to the query with the EntityManager methods that create query objects. Since: JPA 1.0 String query (Required) The query
Forum
3

Merge with Parent/Child entities not possible

javax.persistence.Entity; import javax.persistence.EntityManager; import javax.persistence ... id) {    this.id = id;   } } private EntityManager createEntityManager(String dbFileName ... ("objectdb:" + dbFileName);   EntityManager entityManager = emf.createEntityManager
Forum
3

Updating Entities

"); public static EntityManager employeeDB = emf.createEntityManager(); public static EntityManager ... EntityManagers were not communicating their changes to each other. Which is where my question comes in ... within their respective EntityManager i.e. EmployeeOverview deals with employeeDB - PaygradeOverview deals
Forum
3

Internal exception when updating date filed (TemporalType.DATE)

;         private EntityManager entityManager;         public DataManager(String connectionString ... );             entityManager = entityManagerFactory.createEntityManager();         }         public void ... :" + newBirthday.toString());             try {                 entityManager.getTransaction().begin
Forum
3

@OneToMany(fetch = FetchType.LAZY) list is always null

") private EntityManager entityManager; @EJB private Manager manager; private ... = entityManager.createQuery("SELECT p FROM Parent p"); parents = query.getResultList ... (unitName = "my-pu") private EntityManager entityManager; public void persist(Object o