Questions tagged [hibernate-entitymanager]

Hibernate EntityManager implements the programming interfaces and lifecycle rules as defined by the JPA 2.0 specification.

Hibernate EntityManager implements the programming interfaces and lifecycle rules as defined by the JPA 2.0 specification. For more informatio refer the link.

288 questions
0
votes
1 answer

clarification on behaviour of merge

Suppose I have an object A with id 1 on my persistence layer (i.e. on the DB) If I do the following A a = new A(); a.setId(1); a.setSomeField("a value"); A managed_a = entityManager.merge(a); would the entity manager retrieve the persisted entity…
GionJh
  • 2,742
  • 2
  • 29
  • 68
0
votes
1 answer

test class getting null values for path and query

I am trying to test createQuery db call but getting null pointer exception @Override public Member fetchMemberByNetworkId(String networkId) { List memberList = new ArrayList(); CriteriaBuilder cb =…
Bhavana k
  • 1
  • 1
  • 4
0
votes
0 answers

Errors with project when upgrading hibernate version

I was trying out a sample project spring-data with hibernate as the JPA provider.(from this link: [https://github.com/Fruzenshtein/spr-data][1]). It uses Hibernate-entitymanager 4.2.1.Final. After upgrading Hibernate to 4.3.10, I am getting…
0
votes
1 answer

Hibernate criteria order by a linking table column

I have membership and person tables that are linked with manyToMany relationship via a person_membership table. The person_membership table include person_id, membership_id and a sequence_number. The Membership entity has the below code to link to…
zoro74
  • 171
  • 15
0
votes
2 answers

RangeQuery with Integer fields not giving expected result

following are two fields defined in the entity @Column(name = "min_price") @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO) @NumericField @FieldBridge(impl = IntegerBridge.class) private Integer minPrice; @Column(name =…
Dax Joshi
  • 143
  • 11
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
2 answers

Hibernate Search integrated into Play Framework (JPA)

Im am trying to use Hibernate Search together with Play Framework. It seams very easy and straight forward. But I get a exception (see below): Here is what I did: I added dependencies "org.hibernate" % "hibernate-entitymanager" %…
nickik
  • 5,809
  • 2
  • 29
  • 35
0
votes
2 answers

EntityManager.merge()

ReportDimensions.java: package com.test.main.domain.resource; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import…
Jop.pop
  • 335
  • 4
  • 18
0
votes
1 answer

entitymanager will not persist all phones for contact

I've got the following entities. Contact. Person. Organisation. and Telefoon (Phone in english). An Person and an Organisation are both Contacts. they inherit from Contact. An contact can have one or more phonenumbers. So an List from Telefoon. An…
Fosa
  • 457
  • 1
  • 5
  • 17
0
votes
0 answers

Nullable entity manager using JSF, Spring and Hibernate

I have a problem with the entity manager, it returns null. I have configured persistence.xml and applicationContext.xml and when I create a test class the Junit works and create the tables in the database. But when I try do insert with jsf the…
abka14
  • 1
  • 2
0
votes
0 answers

NullPointerException in init method of EntityManagerFactory

I am getting the following error while trying to run a Spring Data JPA project. I am new to Spring so I guess I'm doing something wrong. "C:\Program Files\Java\jdk1.8.0_25\bin\java" -Didea.launcher.port=7536 "-Didea.launcher.bin.path=C:\Program…
0
votes
1 answer

Show DBMS version in hibernate log

the problem I posed the in following question. becomes blocking, I tried to change the version of ojdbc14 to ojdbc6. I want to display the version of the DBMS in the log, what properties I should add that to the JpaProperties displays the version…
CHHIBI AMOR
  • 1,186
  • 2
  • 13
  • 27
0
votes
1 answer

tomcat connection interrupted after a period of inactivity

I am developing an application with spring and hibernate entityManager The oracle database is outside the DMZ. the connection will be interrupted after a period of inactivity by the firewall. I added the ValidationQuery select 1 from dual in…
0
votes
1 answer

Weld and a EntityManagerFactory Container Managed

I need to know how ensures that container closes EMF (using wildfly 8.0 and hibernate-jpa). Every time that I undeploy my app a instance of WeldJpaInjectionServices$EntityManagerResourceReferenceFactory stays on memory holding a EMF instance. This…
Dyorgio
  • 1,114
  • 13
  • 23
0
votes
0 answers

javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement

I could not understand what I'm doing wrong Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'USER_ID' cannot be null User and Document Id are auto increment ... @GeneratedValue(strategy =…
ramirescm
  • 1
  • 1
  • 3