Questions tagged [hibernate-5]
The hibernate-5 tag has no usage guidance.
hibernate-5
24
questions
0
votes
0
answers
22
views
Migrate Projections"e from Hibernate 5.X to Hibernate 6.X?
I know there are a lot of topics on this already but certain areas I haven't been able to find how I should perform the migration. Specifically I'm having issues with Projections and Restrictions....
0
votes
2
answers
1k
views
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 = ...
0
votes
0
answers
278
views
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration Exception
I am learning Hibernate and tried a simple program. I used Hibernate 5.3 version and added all the Hibernate required .jar files to the build path. I can find the Configuration class in the ref ...
0
votes
1
answer
374
views
JPA/Hibernate does not properly find the database schema of a non-XA data source in Wildlfy 24.0.1.Final/Hibernate 5.3.20
Issue description
I am migrating a project from Wildfly 8.2.1.Final to a newer version. The main objectives are to use Hibernate 5 with Java 8+ and to run on a Wildfly version compatible with java 11, ...
5
votes
1
answer
840
views
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 ...
1
vote
1
answer
941
views
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 ...
0
votes
5
answers
3k
views
java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped
I know this has been asked many times, but none of the answers have solved the problem so far.
My code was working perfectly for years up until I upgraded from Hibernate 4.3.11 to Hibernate 5.2.0. Now ...
0
votes
0
answers
393
views
How to lock() a JPA/Hibernate entity when all one has is that entity (no EntityManager/Session)?
I am dealing with some legacy code that, in places, does not have a clean and reliable way of obtaining a JPA EntityManager (or Hibernate Session) for a given entity as needed to invoke a lock(...) ...
0
votes
1
answer
45
views
How can I add custom db objects during schema generation with Grails 4.0.5 (Hibernate 5) without the need for migration plugin?
I need to add a couple functions and views that are part of the system schema design. This should be part of the session start up (especially in development and test) because of the dbCreate create-...
1
vote
0
answers
799
views
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 ...
2
votes
0
answers
218
views
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.
...
1
vote
1
answer
436
views
Date Functions in hibernate 5 HQL
So I'm kind of new to hibernate, hence just bear with me here. I have a mysql query like so:
SELECT SUM(PLAN_ID), USER_ID
FROM TABLE_A
WHERE ACTIVATION_DATE
BETWEEN DATE_ADD(LAST_DAY(...
1
vote
2
answers
3k
views
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 ...
4
votes
1
answer
3k
views
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 ...
3
votes
0
answers
2k
views
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 here:
https://...