142 questions
2
votes
0
answers
122
views
Hibernate 6 native query on parent class fails with “ORA-17006: Invalid column name”
After upgrading from Hibernate 5 to Hibernate 6, a native query that used to work now fails with an “ORA-17006: Invalid column name” error.
Entity definitions
Base class:
@Entity
@Table(name = "...
1
vote
2
answers
66
views
After migrating to Hibernate6 "LazyTableGroup cannot be cast to class PluralTableGroup" exception
I am migrating a project from Spring Boot 2.7.18 to Spring Boot 3, and this causes a Hibernate upgrade as well from Hibernate 5.6 to Hibernate 6.1.7.
I had a rather complicated criteria query. After ...
1
vote
0
answers
85
views
Handling UNION Queries in Hibernate 6 with Single-Table Inheritance
I understand that Hibernate, by design, does not support UNION in HQL/JPQL. However, in my project, queries are generated dynamically based on user input, and in some cases, they become complex, ...
-2
votes
1
answer
100
views
Migrating from Hibernate 5 to 6 results in error that target lists have at most 1664 entries
When migrating from WildFly 26 (Hibernate 5 and JavaEE 8) to WildFly 35 (Hibernate 6 and Jakarta EE 10) I am getting the error below for the same Entity-Model:
target lists can have at most 1664 ...
1
vote
0
answers
62
views
Deploy an EAR with Hibernate 6.6.17 in wildfly 27
I want to upgrade my EAR to use the hibernate 6.6.17 instead of wildfly defailt 6.1.5. I want to do this by making changes in the EAR and not touching the wildfly setup
I have created a jboss-...
0
votes
1
answer
74
views
Hibernate 6 - Can not invoke "Object.getClass()" because "value" is null
I had issue after moving to Hibernate 6.7 following update criteria query snippet was causing an exception in new SQM model.
criteriaQuery.set(root.get(MyEntity_.tag), null as Tag?)
was throwing an ...
1
vote
0
answers
194
views
Hibernate @JdbcTypeCode(SqlTypes.JSON) with Oracle BLOB throws ORA-17004
I'm using Hibernate with a column declaration like this:
@JdbcTypeCode(SqlTypes.JSON)
@Column(name = "user_addl_info")
private Map<String, Object> additionalInfo;
This works perfectly ...
1
vote
0
answers
102
views
Hibernate 6 Migration: OptimisticLockException and TransientObjectException When Copying Entities Between Two SQLite Databases
Use Case
Users can copy a subset of entities and their object graphs from a main SQLite database to an archive SQLite database, preserving IDs and relationships (1-to-1 copy). After migrating from ...
0
votes
0
answers
123
views
How to define filter at one place in hibernate 6.x
Recently I upgraded to Hibernate 6.x version in my springboot project and
earlier I defined same filter in three entity class @FilterDef
but now it is throwing an error that Mulitiple @FilterDef ...
0
votes
0
answers
52
views
Batching in criteriaQuery is throwing exception while migrating from Hibernate 5 ->6
I am facing some Parameter Binding issue:
java.lang.IllegalArgumentException: Cannot create binding for
parameter reference
[org.hibernate.query.sqm.tree.expression.ValueBindJpaCriteriaParameter@...
0
votes
0
answers
28
views
How to Handle Null Foreign Key (link_ent_id) with Non-Null Discriminator (link_ent_type) in Hibernate?
I have a Hibernate entity mapping with a polymorphic association that uses a discriminator column to determine the entity type and a key column for the specific entity ID. Below is the relevant ...
0
votes
0
answers
96
views
Subclasses causing UnknownTableReferenceException when upgrading to Hibernate 6
I am getting an exception with a construct that was find in Hibernate 4 and 5, but now causing an issue with 6.
Spring Framework and Hibernate are both at 6.0 and I have updated javax to jakarta as ...
0
votes
1
answer
198
views
Type declaration in Hibernate 6
So I was upgrading my old application to Hibernate 6, I was able to get most of the code sorted.
But this one column type is causing a problem.
@Column(name = "JOB_ID", columnDefinition = &...
0
votes
1
answer
464
views
CustomH2Dialect in Hibernate 6.5
We are in the process of upgrading our project from Spring Boot 2.7 to 3.3.5, which includes an upgrade to Hibernate 6. In production, we use PostgreSQL, and for local development, we use H2.
Our ...
0
votes
2
answers
112
views
Hibernate OneToOne association, owning side not saving foreing key
I'm learning Hibernate (v. 6.6.1 final) and have a problem with a OneToOne relation
Customer Entity
@Entity
@Table(name = "customer")
public class Customer {
@Id
@Column(name = &...