Questions tagged [hibernate-mapping]
Hibernate uses mapping metadata to find out how to load and store objects of the persistent class. The Hibernate mapping could be specified using configuration files or annotations.
hibernate-mapping
3,252
questions
1
vote
0
answers
20
views
How to implement a double relation between entities with hibernate 6.5
I have a database on which 2 tables have a double relationship :
Database graph
The Spot may be the parent of several SpotConditions, so there is a basic OneToMany relationship.
But in addition, each ...
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
11
views
Problem with Hibernate 6 and multi level inheritance: Add joins
I'm facing a problem when using a 2-level inheritance in Hibernate 6.2.13.Final.
I have a grandfather class: ClinicalAct
I have a father class: Consultation that extends ClinicalAct
I have 2 children ...
0
votes
0
answers
19
views
Hibernate can't find a table from postgresql database [duplicate]
Well, I have a postgresql database and table:
Structure in postgresql
So, i want to get all records from "SheduleRecords" table using Hibernate.
Table structure:
All types are "...
0
votes
1
answer
42
views
Joining Entities by a Range - Hibernate
I have a question regarding Hibernate that's been bothering me for some time.
Consider I have two entities:
@Entity
public class Statement {
@Id
@Column
private int id;
@Column
...
0
votes
0
answers
39
views
Joda-time type mapping in Hibernate ORM 6
I'm new to Java and I am trying to migrate from Hibernate 5 to 6. My application uses joda-time for the timestamp data type. It is using both annotation and hibernate mapping files.
Following is a ...
1
vote
0
answers
24
views
Calling stored procedure with Hibernate which multiple type of outputs
I have a stored procedure from my DBA team. Here is the stored procedure, and temp table created. All I want to know here, how to map the temp table to the output value while calling the procedure in ...
0
votes
0
answers
37
views
SoftDelete issue
I am encountering an issue with the @SoftDelete annotation in my entity class. It forces eager loading, which is causing performance issues.
Consider the following class:
@Entity
@Data
@SoftDelete
...
1
vote
1
answer
34
views
Hibernate try to set my id field to the current object, what am I doing wrong?
I searched for a long time but I cannot understand what I am doing wrong here.
I'm using spring boot with starter-data-jpa. Versions:
Hibernate: 6.3.1.Final
HikariCP: 5.1.0
springboot dependency ...
0
votes
0
answers
32
views
Multiple ManyToOne relationship raised not mapped to a single property error
I have 3 entity class
Parameter entity class with multiple ManytoOne relationship.
Entity class below
@Entity
@Table(name = "t_gcg_parameter")
public class GcgParameter extends Common ...
0
votes
0
answers
32
views
@TypeDefs and @TypeDef equivalent in hibernate 6
As a part of springboot migration from 2.3 to 3.0.13 I've the below classes which comes from the springboot 2.3 It seems that annotations @TypeDef and @TypeDefs are removed how to make below code ...
0
votes
0
answers
7
views
I can't find the foreign key column in the tables in one-to-one mapping using xml approach
I have bidirectional mapping. these are model classes
public class Address {
private Long aId;
private String street;
private String city;
private String state;
private String country;
private ...
0
votes
0
answers
13
views
Spring boot - Hibernate - Many to many - Saving/Updating Entity
package com.dharma.associations.manyToMany.entities;
import jakarta.persistence.*;
import java.util.HashSet;
import java.util.Set;
@Entity
@Table(name = "programmer")
public class ...
0
votes
1
answer
38
views
Using @SqlResultSetMapping to map to list
Person
ID
Name
1
Luis
2
Frank
Address
Person-ID
Address
City
1
Samantha Road
x
1
Franklin
y
In my Hibernate native query I want to map the result of one person to a set of addresses, such like ...
0
votes
0
answers
42
views
How to Map XML values from a database using Hibernate?
Im using Hibernate to get information form an Oracle DB and im getting stuck because one of the columns is used to store xml files.
I need a way to get those files in a way where I can actually read ...