Questions tagged [hibernate-5]

24 questions
8
votes
2 answers

org.hibernate.UnknownEntityTypeException: Unable to locate persister: entity.Settings

I am trying to use Hibernate 5 (5.2.11) together with Spring ORM. Following tutorials I came up with following configuration: Spring Bean
Hannes
  • 5,002
  • 8
  • 31
  • 60
4
votes
1 answer

Hibernate Interceptor not working after upgrading to Hibernate 5

Earlier my Interceptor code was working fine for Hibernate 3. After I upgraded to Hibernate 5 and made the necessary changes, callback methods like onSave & onFlushDirty stopped working. Regarding library changes, below Hibernate 3 jars I replaced…
4
votes
1 answer

NamingStrategy in Hibernate 5 compliant with Hibernate 4

We're currently trying to move our web app from Wildfly 9.0.2 to Wildfly 10.1.0, and so migrating from Hibernate 4.3.10 to 5.0.10. We never defined our own NamingStrategy, using whatever names Hibernate chooses for our Entities (our Postgresql…
Xavier Portebois
  • 3,354
  • 6
  • 33
  • 53
3
votes
1 answer

Confusion about EntityManagerFactory and SessionFactory with Hibernate 5.3, Spring Data JPA 2.1.4 and Spring 5.1

I tried to figure out the new mechanism for integrating Hibernate and Spring Data JPA. I followed the example provided on https://www.baeldung.com/hibernate-5-spring but to no avail. Further research brought me an issue on Github by Juergen Hoeller…
3
votes
0 answers

Getting a circular reference to entityManagerFactory when trying to use it in Spring Boot autoconfigured DataJpaTest

I'm migrating an application from Spring Boot 1.5.14.RELEASE to 2.0.4.RELEASE. I'm using Java 8 and Maven 3.5.4 if it matters. Please, see the complete project reproducing the issue…
Dmitry Senkovich
  • 5,521
  • 8
  • 37
  • 74
3
votes
1 answer

What is the difference between javax.persistence.criteria and org.hibernate.criterion packages?

Recently my team upgraded from Hibernate 3 to Hibernate 5 so I am working on the migration stuff. Now when I try to use CriteriaQuery class, eclipse shows that it can be imported from both 'javax.persistence.criteria' as well as…
DockYard
  • 989
  • 2
  • 12
  • 29
3
votes
1 answer

Hibernate 5: how to ignore naming strategy for @Column?

Our project will update to Hibernate 5. We have some databases that are controlled by a 3rd party. Before Hibernate 5, we used ImprovedNamingStrategy's entity's property ignore strategy if annotation @Column(name="xxxxxx"). xxxxxx maps to the…
Cheng
  • 316
  • 3
  • 9
2
votes
0 answers

How to prove JPA Enity must not be final class with Hibernate 5

JSR 338: JavaTM Persistence API 2.1 Specification > 2.1 The Entity Class specifies: The entity class must not be final. No methods or persistent instance variables of the entity class may be final. So I tried with Hibernate 5.2.18.Final to prove…
Rui
  • 3,454
  • 6
  • 37
  • 70
2
votes
1 answer

A different object with the same identifier value was already associated with the session cascade merge

I read about the error in title but I can't find suitable solution for my case, I have the following relation : @Entity public class Parent { @OneToMany(fetch = FetchType.EAGER,mappedBy = "parent",cascade = CascadeType.MERGE) …
Mohammad Karmi
  • 1,403
  • 3
  • 26
  • 42
1
vote
1 answer

Hibernate support for JDBC specification 4.3?

In the docs for Hibernate ORM 5.4 it states that the System Requirements require at least Java 1.8 and JDBC 4.2. The same can be found for the docs for version 6.0. Hibernate 5.2 and later versions require at least Java 1.8 and JDBC 4.2. So is the…
Navigatron
  • 2,065
  • 6
  • 32
  • 61
1
vote
0 answers

org.springframework.dao.CannotAcquireLockException: could not execute statement

org.springframework.dao.CannotAcquireLockException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.LockAcquisitionException: could not execute statement Full stack trace of the…
chinnu Nish
  • 119
  • 1
  • 13
1
vote
2 answers

Updating to Hibernate 5.1 from 3.6 produce Non-entity object instance passed to evict exception

I was working with a hibernate 3.6 project which use annotations for mapping and now I migrate it to hibernate 5.1 and i have this run time exception Non-entity object instance passed to evict Below is the call to…
Lilac
  • 580
  • 1
  • 7
  • 25
1
vote
2 answers

How to use generic type parameter with Hibernate 5?

Below are the class definition interface public interface myInterface{ void myMethod1(); } MyClass1 Class which implements above interface @Entity public class MyClass1 implements MyInterface{ @Id private int id; private String…
Karthik Prasad
  • 9,662
  • 10
  • 64
  • 112
0
votes
0 answers

Hibernate 5.4 filter support with JPA 2.1

Have search on many place's but did't found a single statement about the Hibernate filter (5.4) version support with JPA 2.1 Is JPA 2.1 and hibernate filter 5.4 compatible or not ? I can see most of the things are depricated by Hibernate in 5.4 So…
0
votes
2 answers

StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) on more than 2 updates

Basic update is working fine if i manually set the DTO. Stale Exception is caused by Mapper and BeanUtils.copy properties //Mapper @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE) public abstract void…
jslearner07
  • 451
  • 1
  • 4
  • 17
1
2