The EntityManager is the representation of a PersistenceContext, allowing a user to manipulate data pulled from a database.
Questions tagged [entitymanager]
1802 questions
0
votes
0 answers
JPA EntityManager not merging entity in target Database
I am performing a task of reading a row from a source database and if same record exists in target database then merging the row in target database. I have checked the datasource's of both entityManager objects and they look fine.
I am creating a…

Anand Kadhi
- 1,790
- 4
- 27
- 40
0
votes
0 answers
Spring Auto-Wiring Beans with @Autowired annotation returns null
Im trying to migrate my ejbs to Dao's and here is my implementation :
Frameworks :
Struts 2, Spring 4.3.7, Hibernate 4.3.10
Web.xml :
contextConfigLocation
…

Jeff
- 1
- 1
0
votes
0 answers
Best way to design the dao to get the entity manager based on the persistence unit
I'm working on a project which has 3 different persistence units.
I have a BaseDaoImpl which has an entitymanager (with persistence unit "A") and all the CRUD operations.
BaseDaoImpl will be extended by other DAO classes.
I'm stuck in a situation…

Karthik
- 1
- 1
0
votes
2 answers
Get just added Object with EntityManagerFactory
I'm developing a java app with MySql database, JPA objects and EntityManagerFactory with EclipseLink to manage the database. Everything works Ok but I have an issue.
One of my JPA objects is like this
public class JPAObject1{
@Id
…

Rubén M
- 107
- 1
- 1
- 13
0
votes
0 answers
Retrieving query results with getResultList() taking too long
I have a query in the following form
Query query = getEm().createNativeQuery("SELECT i.claimid, i.attachmentfilename, i.invoiceid, i.invoicedate, i.invoicenumber, "
+ "i.invoicetypeid, i.dealerinvoicenumber, i.bdxid, i.capturedate,…

Bongo
- 333
- 3
- 12
0
votes
1 answer
Symfony 3 dynamic SQLite database depending on route
I'm starting my first project with Symfony.
I'm trying to figure if what I want/need is feasible.
I use Doctrine ORM with 2 entity manager, one for the app itself with MySQL database and one for the users data that are SQLite databases.
I want…

Patrick Pellegrino
- 51
- 1
- 10
0
votes
1 answer
Can one create function handle any kind objects using EntityManager (JPA)?
Below code uses JPA and Spring and can create a row in the table "games".
@Repository
@Transactional
public class GameDao {
/**
* Save the game in the database.
*/
public void create(Game game) {
…

brainmassage
- 1,234
- 7
- 23
- 42
0
votes
1 answer
How to use Persistence EntityManager along with SessionFactory in spring 4 hibernate 5?
I was using sessionFactory by autowiring it in my DAOImpl files.
Things were working fine until I started facing an issue of "Too many database connections" in certain DAO methods. After searching for possible reasons and solutions, I realized that…
user7041082
0
votes
1 answer
JPA OneToMany bidirectional relation [EclipseLink-63] error
Please can you help me? In JPA, I try to create a OneToMany bidirectional relation, but I have the following errors :
"[EclipseLink-63] : The instance creation method [entity.OrderLine.], with no parameters, does not exist, or is not…

Malik Berrada
- 9
- 5
0
votes
3 answers
JPA EntityManager - Using merge to generate default value?
I have one JPA entity that has a created date and a modified date column. On creation/persist, both the created date and modified date are generated by the default value given in the database, which is a timestamp. The creation works, however, when…

Racco Taco
- 15
- 7
0
votes
1 answer
How to include doctrine entity manager to files generated by View?
I use mini php MVC. Variables from bootstrap are not included in generated view. I can include entityManager to index.php,
but i am not able to include entityManager to view files. WHy? How to include doctrine entity manager to files generated by…

olga
- 959
- 1
- 15
- 42
0
votes
0 answers
Hibernate EntityManager keeps old data
I have Java EE application with Hibernate. I want to implement a feature that every minute updates one of existing rows in database. I have following classes:
@Singleton
@Startup
public class TimerRunnerImpl implements TimerRunner {
@EJB
…

wynnopin
- 3
- 3
0
votes
1 answer
JavaEE EntityManager exception handling
I'm working on my DAO and can't figure out what's the best way to handle exceptions. While using the .persist() there are 3 exceptions that can be emitted : EntityExistsException / IllegalArgumentException / TransactionRequiredException.
I'm just…

raik
- 33
- 2
- 13
0
votes
0 answers
Entity not mapped, although mapped
I have 2 projects:
1 for the entities
1 for a web service
While using Hibernate 4.3.11.Final everything was working properly. I have a hibernate.cfg.xml where I have all the classes so selecting the entities from the DB was ok using Query
Then I…

Alejandro
- 766
- 9
- 24
0
votes
0 answers
The mysteries of Hibernate lifecycle
I'm using Hibernate with the JPA API in Java and I'm running the following test:
public void test1()
{
A a = new A();
a.setValue(1);
getDao().store(a);
a.setValue(2);
A loaded = getDao().load(a.getId());
assertEquals(1,…

FarwoodHill
- 552
- 1
- 9
- 18