95,147 questions
0
votes
0
answers
17
views
org.hibernate.query.sqm.UnknownEntityException: Could not resolve entity class after upgrading to hibernate 6.6
I have a test case that tests all the DAOs in my project. It uses openpojo to get the list of all DAO classes. The test case then iterates over the list of DAO classes and invokes all methods in them ...
0
votes
0
answers
62
views
Spring Boot 2.7.x JPA @ManyToOne join returns empty list on GET, but works on POST
In a Spring Boot 2.7.x application with Hibernate/JPA, there are two tables:
tickets
complaint_id (PK, VARCHAR(255))
attachment
complaint_id (FK, VARCHAR(255))
other fields: id, file_name, ...
0
votes
1
answer
94
views
Spring Boot 3.3 migration. Cannot resolve reference to bean jpaSharedEM_entityManagerFactory
I'm migrating from Spring Boot 2.7 to Spring Boot 3.3.13. This means that I'm migrating even from Hibernate 5 to Hibernate 6.
I'm having an annoying problem when I start my Spring Application about ...
1
vote
0
answers
75
views
How to pass client location into custom JPA ID generator?
Working on a scalable custom ID generator in JPA. The format I want to achieve is:
<first three letters of country or region> + <year> + <sequence number>
For example: USA2025001
I'm ...
5
votes
1
answer
147
views
Integrating a Jakarta Persistence implementation with modular JavaFX/Maven/JLink app
Quick background information for context: I'm writing a relatively small tool for a small gaming community to download and manage user generated content. It's a modular Java 24 + JavaFX Project done ...
1
vote
1
answer
83
views
JPA OneToOne Field 'price_id_price_id' doesn't have a default value
how do I resolve that error? Thank to all answers.
org.springframework.orm.jpa.JpaSystemException: could not execute
statement [Field 'price_id_price_id' doesn't have a default value]
[insert into ...
1
vote
1
answer
47
views
Redis as L2 cache for Hibernate can't find the redisson.yaml in my deployments
I am trying to make the redis sentinel pods in my cluster as my L2 cache for hibernate JPA.
I am using wildfly 32.0.1.Final server with my deployment structure having a ear with a lib and a META-INF ...
2
votes
0
answers
47
views
Hibernate Envers does not persist foreign key in audit table
I'm using Hibernate Envers to audit a @OneToMany relationship between two entities: ParentEntity and ChildEntity.
I am not using @ManyToOne on the ChildEntity side. Instead, I store the foreign key ...
3
votes
3
answers
171
views
How to model JPA relationships when users live in Keycloak? [closed]
I couldn't find a definitive best practice for this, so I’m hoping the discussion helps others as well.
In a traditional setup (without Keycloak), we keep an application-level User entity with JPA ...
2
votes
1
answer
70
views
How to use jsonb functions in hibernate 6?
We use Postgres jsonb_agg function in criteria query API like this:
cb.function(
JSONB_AGG_FUNCTION_NAME,
JsonNode.class,
someJoin.get(someField)
...
0
votes
1
answer
42
views
Enable Hibernate @Filter as default in Springboot for soft delete
I defined a Hibernate Filter to filter out the deleted records.
My wishlist:
The Filter should be enabled all the time as default.
Only in special cases when I need the deleted records, then I would ...
1
vote
0
answers
42
views
How can I map a column of Json Array into a list or map of non-pk column mapping?
I have two tables.
-- child
id key (VARCHAR, UNIQUE)
----------------------------------
0 'a'
1 'b'
-- parent
id child_keys (JSON)
---------------------------...
2
votes
2
answers
105
views
Mapping multiple subclasses to same Parent ID in JPA Joined Inheritance
I created the tables Person, PersonExtra, PersonBasic, etc. in my database with the superclass Person and subclasses PersonExtra and PersonBasic.
@Entity
@Table(name = "person")
@Inheritance(...
2
votes
0
answers
84
views
What is the proper way to expose JPA managed entities in Java Entity Models?
Say I have a model with a many to many or many to one relationship. This model would like this:
@Entity
public class A {
// other fields ...
@OneToMany(...)
private List<B> bEntities = ...
1
vote
1
answer
42
views
How do GWT RPC transactions work with JPA/Hibernate on a database? [closed]
Working on this huge DAQ project made with GWT(mariaDB as db) , my main purpose is to replace some UI components and with them, their functionalities(for this case, users management , where you can ...
2
votes
0
answers
115
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
0
answers
27
views
Hibernate (5.3.3.Final) + Redisson (3.17.7) in a SBT project isn't evicting the cache from redis based on configured TTL
I am using a java-scala project and have configured the RedissonClient programmatically:
public class RedissonConfigurationFactory extends RedissonRegionFactory{
private static RedissonClient ...
1
vote
2
answers
59
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 ...
0
votes
1
answer
121
views
Custom postgres dialect isn't being picked up by spring
I have a Spring project with a PostgreSQL database. I'm trying to add a custom dialect, but I've noticed that Spring is not loading it.
My dialect:
package org.company.configuration;
public class ...
0
votes
0
answers
113
views
Unable to determine Dialect without JDBC metadata despite correct properties
I got this following error. I'm using Hibernate 6 and Spring Boot 3.5.6. I've already set the spring.datasource.url in my application.yml file. The username and password are already correct. Am I ...
0
votes
1
answer
84
views
Quarkus 3.27.0 and hibernate-scan-jandex
We have a parent pom that imports the quarkus-bom via:
<quarkus.platform.version>3.27.0</quarkus.platform.version>
and
<dependencyManagement>
<dependencies>
...
0
votes
1
answer
77
views
Single Save with JPA CascadeType.PERSIST resulting to wrong order of insetion
I have the following scenario:
class A {
@OneToMany(mappedBy = "a", cascade = {CascadeType.PERSIST})
List<B> bsOfA;
@OneToMany(mappedBy = "a", cascade = {CascadeType....
0
votes
1
answer
93
views
Executing lambda functions inside transactionExecutor threads for unit tests
i have few methods that need to be iterated in new transactions but facing errors when i try to write unit tests for them
@Inject
private SchedulerUtil schedulerUtil;
@Inject
private ...
0
votes
1
answer
67
views
What relationship should be used
I have a table (product) as follows which holds product related data
@Entity
@Table(name = "product")
public class ProductEntity {
@Id
@GeneratedValue(strategy = GenerationType....
1
vote
0
answers
94
views
Hibernate bytebuddy loaded in native image after migration to 6.6.23.Final
I am migrating Hibernate in Helidon from version 6.3.1.Final to version 6.6.23.Final, and a new error started to happen with native image:
Error: Classes that should be initialized at run time got ...