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
5
votes
0 answers

JPA With hibernate, setting AvailableSettings.USE_CLASS_ENHANCER property to true throws java.lang.ClassCircularityError

I setup spring application. Everything works fine. But when I set Hibernate AvailableSettings.USE_CLASS_ENHANCER property to true then I get java.lang.ClassCircularityError. Here is my configuration. First of all I am using log4j2. Here are my…
Basit
  • 8,426
  • 46
  • 116
  • 196
5
votes
1 answer

JPA 2.1 Type Converter doesn't get executed on NULL values

I'm testing the new JPA 2.1 Type Converters. I want to avoid NULL String values to be stored in a legacy database as they are not allowed. So I defined the following converter: @Converter(autoApply=true) public class CString implements…
Manuel Z
  • 51
  • 1
  • 2
5
votes
1 answer

Spring 4, Hibernate JPA JarInputStreamBasedArchiveDescriptor Error on Websphere 8.5.5

I have a Spring MVC/Spring-Data-JPA (with Hibernate) application running perfectly on the Websphere 8.5.5 Liberty Profile. However, when I deploy to the full version of Websphere 8.5.5. I get the error pasted below. My other beans naturally rely…
4
votes
1 answer

how to @FilterJoinTable with EntityManager in Hibernate JPA?

I would like to limit the data that is coming from OneToMany relation. In my program the boss account can view all the company's that have orders in the given month and year. The company class can f.e. count the income from these orders. I used…
Rafał Rowiński
  • 606
  • 1
  • 11
  • 23
4
votes
1 answer

JPA - createEntityManagerFactory returns Null

Noob question here. I'm following this example/tutorial to try and isolate a problem I keep getting on my main project. Problem is, the entityManagerFactory keeps returning null (thus, I get a NullPointerExcept when trying to run the first JUnit…
Gaston
  • 840
  • 1
  • 18
  • 27
4
votes
1 answer

Hibernate Envers: Audit Reader throws LazyInitializationException when trying to get revision history

I successfully configured Hibernate Envers entities I want to audit, but when I try to get audit history using Audit Reader I get java.lang.NoSuchMethodError. Code snippets is shown below. Domain model…
4
votes
2 answers

Hibernate Entity manager auto flush before query and commit changes to DB in transaction

I am using Hibernate 3.6.0 with JPA 2 on Jboss AS 6.0.0 final. In an EJB of mine, there's a method which updated entity values and do some query on it. The whole method is running in a BMT transaction. If anything fails, all changes should be…
4
votes
2 answers

hibernate session.get does not load persistent object when migrate from hibernate 4.3.11 to 5.2.10 and use EntityManager insteadof SessionFactory

For a years in a project i used from hibernate 4.3.11.Final and spring 4.3.1.RELEASE to maniuplating and persisting objects. Newly i migrated to hibernate 5.2.10.Final and encountered a problem that describe it. I have two domain class as you can…
Rasool Ghafari
  • 4,128
  • 7
  • 44
  • 71
4
votes
0 answers

Hibernate Where annotation ignored when querying nested objects

I noticed this weird behaviour in my model. (this is my model): @Entity(name = "A") public class A { @Id public String aId = UUID.randomUUID().toString(); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) …
pandaadb
  • 6,306
  • 2
  • 22
  • 41
4
votes
3 answers

why the lazy collection is loaded

I have a Project entity with a oneToMany relationship with Event entity public class Project { .... @OneToMany(mappedBy = "dossier", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) private List events; } I…
Olivier Boissé
  • 15,834
  • 6
  • 38
  • 56
4
votes
1 answer

Memory leak in Hibernate session?

I am experiencing a memory leak in a Hibernate session. A long running thread is continuously loading and updating data. While the thread regularily calls entityManager.clear() I observe both: 1.) growth in Session-size (linear growth since start…
Jonathan
  • 2,698
  • 24
  • 37
4
votes
1 answer

Hibernate EntityManager 4 ClassNotFound Exception

I upgraded my application from hibernate-entitymanager-3.6.10.Final to hibernate-entitymanager-4.1.6.Final by using maven. At the application initialization phase it raised the following error; java.lang.NoClassDefFoundError:…
hjunior
  • 91
  • 2
  • 6
4
votes
1 answer

hibernate not-null property references a null or transient value:

This problem appears randomly. Program has worked well for over a month and today it crashed. While adding a new order the user can choose a company from the dropdown list. Then he can save new order to the database. It works most of the times even…
Rafał Rowiński
  • 606
  • 1
  • 11
  • 23
3
votes
0 answers

javax.persistence.TransactionRequiredException: Executing an update/delete query : Spring boot Migration from 1.5.4 to 2.7.5

I am migrating the spring boot app from spring boot 1.5.4 to spring boot 2.7.5, In old code I have hibernate at DAO layer. (does the migration caused the issue, I did not find very particular about the issue ) properties file has connection details…
3
votes
2 answers

EntityManager.unwrap() throws java.lang.AbstractMethodError

I'm having some issues implementing JPA 2.0 in my app. I'm using Criteria queries and I need to grab the session from the EntityManager. I do it in the following way (according to this) Session ses = entityManager.unwrap(Session.class); After…
ariel_ro
  • 33
  • 1
  • 4
1
2
3
19 20