Questions tagged [entitymanager]

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

1802 questions
0
votes
1 answer

Can not create the query using entity manager

When i am executing this code (JPA) Query q=entityManager.createQuery(SELECT mc.account_no,mc.expiry_date, SUM(CAST(CONCAT(mc.sign,mc.balance) AS NUMBER)),mc.moneybank_id FROM muthutcardbalance mc WHERE mc.account_no='20' AND…
user5122076
0
votes
2 answers

Why JPQL generated query differs from original

I am reviewing a JPQL query like that: SELECT SELECT SUM( func('NVL', l.prim_emiti_ced_periodo, 0) + func('NVL', l.prim_dev_n_emiti_ced_fin, 0) - func('NVL', l.prim_dev_n_emiti_ced_ini, 0)) primas_cedidas_netas, SUM( …
Fran Montero
  • 1,679
  • 12
  • 24
0
votes
0 answers

How to manage the concurrency using JTA(entityManager) so that the application can scale at large number of concurrent users?

I am having a Java EE application that uses JPA as a persistence framework having transaction type JTA. I am using EntityManager annotated with PersistenceContext. My SessionBean looks like this: package com.session; import…
0
votes
1 answer

ClassNotFound : javax.persistence.Persistence when creating entity Manager Factory

I am working on a project with JSF and hibernate. I divided the project into 3 layers (view, service, DAO) in service layer I am creating an instance of DAO class, but when reaching Persistence.createEntityManagerFactory("E_GYM") it throws an…
Omar.Nassar
  • 379
  • 1
  • 3
  • 14
0
votes
0 answers

How I write with the EntityManager in MySQL Database?

hi i have a java ee application and use JPA. (EJB). I have two Entities. The Ticket and the User Class. My Problem is that I dont can write the User in the Database :( The Ticket works...! here is the user class: @Entity @NamedQueries({ …
Tarasov
  • 3,625
  • 19
  • 68
  • 128
0
votes
2 answers

Issue with hibernate entity manager on multiple servers

I am using hibernate in dropwizard framework. Configuration of application: having a loadbalancer for the backend for multiple servers. The issue is when i am saving a new record, the records get saved in the database. But when i am trying to…
0
votes
1 answer

JPA DAO Update row without full row context

Have a table with >70 columns. I use about 8 of these columns with the .java object, including the id - not sure if that matters. My Id column has the following: @Column(name = "pseudonym", nullable = false) @Basic(fetch = FetchType.EAGER) @Id My…
shanehoban
  • 870
  • 1
  • 9
  • 30
0
votes
0 answers

Hibernate Entity Manager

I have a list of Date objects. I assigned that list in setParameter ("dates", datesList) and then I did c.createDate IN (:dates). It does not work (query returns 0 results back). How do I do this? em.createQuery(""" select u.name, s.description,…
JBone
  • 1,724
  • 3
  • 20
  • 32
0
votes
2 answers

spring 4 struts 1.x mixing xml and java config

I am not very familiar with spring, so added everything related to spring. I have a spring 4 struts 1.x application. Spring context is loaded using struts plugin which points to spring-context.xml
almeynman
  • 7,088
  • 3
  • 23
  • 37
0
votes
2 answers

Why is my EntityManager not properly injected?

I tried to build a project with manages Employees using JPA and Beans and JSF. I started trying to manipulated an existing user which I manually created in the database. (before I tried to read the data from the database, this worked well) I tried…
Liae Neya
  • 31
  • 6
0
votes
1 answer

BreezeJs features already implemented by AngularJs?

I was suggested to use BreezeJs for an AngularJs project and I saw that it has some really interesting features. In my case the main interests would be in caching, tracking changes, some light querying, and validation. I think those features can be…
0
votes
0 answers

Refresh collection / empty cache - using entity manager

Hello guys I have pretty strange problem that I cannot resolve my code looks like this: @Transactional public List readproductObjectes() { TypedQuery query = em.createQuery("SELECT productObject FROM…
user3353393
  • 139
  • 3
  • 12
0
votes
1 answer

Spring context unable to resolve among multiple entity managers

I have a module A that has its own EntityManager em. This module is a dependency in other module B. Module B interacts with two instances of same db,and based on business logic I decide which record to store in which db. For this I have two entity…
Philip
  • 28
  • 4
0
votes
0 answers

EnetityManager assigning multiple values to a key

em.createQuery(""" select s.description, avg(c.taktTime) from CountEntity c, SkillEntity s, FwmsUserEntity u, SkillTypeEntity t where c.fwmsUser = u.id *AND s.description in…
JBone
  • 1,724
  • 3
  • 20
  • 32
0
votes
1 answer

JBoss Seam cannot create Java Persistence Entity Manager

I am at a complete loss with this one. I am scouring the Internet via Google to try and find a solution for this problem. I haven't used JBoss in a very long time, and we use Seam version 2 ... not sure what exact version. I've never used Seam…
tjholmes66
  • 1,850
  • 4
  • 37
  • 73