Top "Entitymanager" questions

The EntityManager is the representation of a PersistenceContext, allowing a user to manipulate data pulled from a database.

JPA EntityManager: Why use persist() over merge()?

EntityManager.merge() can insert new objects and update existing ones. Why would one want to use persist() (which can only …

jpa merge entitymanager persist java-persistence-api
What does EntityManager.flush do and why do I need to use it?

I have an EJB where I am saving an object to the database. In an example I have seen, once …

java jpa entitymanager
Create JPA EntityManager without persistence.xml configuration file

Is there a way to initialize the EntityManager without a persistence unit defined? Can you give all the required properties …

jpa runtime entitymanager persistence.xml
What is the best way to update the entity in JPA

I am doing some CRUD operations using JPA. For updating an object which is the right way to do? Through …

java jpa entitymanager
The EntityManager is closed

[Doctrine\ORM\ORMException] The EntityManager is closed. After I get a DBAL exception when inserting data, EntityManager closes and I'm …

symfony orm doctrine-orm entitymanager
JPA With Hibernate Error: [PersistenceUnit: JPA] Unable to build EntityManagerFactory

I have a problem with Java Persistence API and Hibernate. My situation of project is: My persistence.xml file is: &…

eclipse hibernate jpa-2.0 entitymanager
java.lang.IllegalArgumentException: Removing a detached instance com.test.User#5

I have a java EE project using JPA (transaction-type="JTA"), hibernate as provider. I write my beans to handle the …

jpa sql-delete entitymanager illegalargumentexception
JPA merge vs. persist

So far, my preference has been to always use EntityManager's merge() take care of both insert and update. But I …

java jpa merge entitymanager persist
How to implement update () method in DAO using EntityManager (JPA)?

What is the standard way to implement simple update? Example: we have User with phone number NNNNNN and now we …

java jpa entitymanager
Query a MySQL db using java

Guys, simply put, I have a java application with a text output box. I'd like to query a Db and …

java mysql database entitymanager