All Questions
59,307
questions
-1
votes
0
answers
24
views
EntityManager select only OneToMany field give exception
I am using EntityManager in Spring data JPA with Hibernate as provider.
I have 2 entities
Post entity
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Table
@NamedEntityGraph(name = &...
-1
votes
0
answers
48
views
Java app memory increase very fast and GC happening too frequent [closed]
I have a spring boot cronjob running in container. I found that container were killed by kubernetes several times.
This is the memory and CPU profiling of the app when the job is running:
This is ...
0
votes
0
answers
21
views
@JoinColumn "occurs out of order" with spring-boot-3.3.2 (Hibernate 6.5.2 )
I am getting the error:
Caused by: org.hibernate.AnnotationException: Referenced column 'sub_categoryvid' mapped by target property 'id' occurs out of order in the list of '@JoinColumn's
at ...
-1
votes
0
answers
29
views
Bean Validation Not Working with Hibernate Validator in Java Project
I'm encountering an issue with bean validation in my Java project where the expected constraint violations are not being caught. Below are the details of my setup:
Dependencies:
<dependency>
...
-1
votes
0
answers
11
views
Row updated in another transaction error unless there is a breakpoint on the save method
I have 2 methods that update an entity and have similar functionality, but I have inherited the codebase with little testing so don’t want to do a refactor yet.
However, there is a bug in one of these ...
0
votes
0
answers
22
views
Fetch both sides without cyclic infinite loop
public class Famille {
@Id
@GeneratedValue(strategy = GenerationType.UUID)
private UUID id;
@Column(length = 30, nullable = false)
private String nom;
@Column(length = 12, ...
0
votes
1
answer
16
views
JPA Subquery return object and use on query multiselect
I'm have a java spring application that use a criteria query. The query has a multiselect and one of the values is a subquery that bring an complete entity. The application work on original enviroment ...
0
votes
0
answers
14
views
Hibernate Envers - how to map custom RevisionEntity columns into audit queries
I have separated the auditing support and the revisions in my solution. It works fine, but I have no idea how to create a query to get all revisions where the audit data is mapped from the REVINFO to ...
-2
votes
1
answer
30
views
JPA get highest value in column with where condition
I'm using a JpaRepository to access a table in my database. I defined the table through an entity. My goal is, to get the highest value in the wordNumber column. But I also have to distinguish entries ...
-2
votes
0
answers
22
views
How to set foreign key constraint order by JPA annotation? [closed]
I'm using JPA in a Spring-Boot application with JPA (jakarta.persistence Annotations).
The creation of my DB schema (hbm2ddl=create) failed with an:
⚡ Foreign key constraint is incorrectly formed ...
-1
votes
1
answer
27
views
Hibernate session.get Returning Null for Existing Record
I'm using Hibernate in my Java application to retrieve an Alien object from the database by its primary key. However, the retrieved object is null even though I know the record exists in the database. ...
0
votes
0
answers
19
views
Spring JPA - using extra table in @ManyToMany relationship
I have a database structure like this:
entity tables:
CREATE TABLE IF NOT EXISTS city
(
city_id VARCHAR(255) PRIMARY KEY,
name VARCHAR(255) NOT NULL
);
CREATE TABLE IF NOT EXISTS store
(
...
0
votes
0
answers
19
views
Exception in thread "main" org.hibernate.MappingException: Unknown entity....Hibernate-5
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 ...
-1
votes
0
answers
28
views
HsqlDB throwing "user lacks privilege or object not found" intermittently
I am copying data from MS SQL DB to Hsqldb conditionally & processing in my Java program.
The issue is that, after processing some number of records (this differ in each run),I am getting the ...
0
votes
0
answers
35
views
JPQL did not translated to SQL correctly when using Window Functions
Models:
@Entity
@Data
//This is main entity
public class Collection {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@OneToMany(mappedBy = &...