All Questions
Tagged with jpa hibernate-mapping
665
questions
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
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
...
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
159
views
@OneToMany with mappedBy referencing non-association property
Given Hibernate 6.4.4 and the following entities:
@Entity
@Getter
@Setter
public class Parent {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private Long id;
@OneToMany(...
0
votes
0
answers
39
views
Hibernate not generating additional queries while fetching associated entities in eclipse console
Below is my Owning side Entity -
@Entity
@Table(name = "T_PERSON")
@Inheritance(strategy = InheritanceType.JOINED)
public class Person {
private Long id;
private String firstName;
private ...
0
votes
0
answers
22
views
Foreignkey in cat_id is null with bidirectional oneToMany relationship
This is my Category entity:
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
@Entity
@Table(name = "category")
public class Category {
@Id
@GeneratedValue(strategy = ...
1
vote
1
answer
319
views
Generate persistence mapping feature in IntelliJ IDEA has dissapeared?
I have recently upgraded to IntelliJ IDEA 2024.1. I work with the Hibernate framework and I used very often the 'Generate persistence mapping' feature from the Persistence window but it seems that ...
0
votes
2
answers
51
views
Automatically remove a child from its parent
@Entity
public class Book implements Serializable {
@Id
private Long bookId;
private String title;
@ManyToOne
@JoinColumn(name = "author_id")
private Author author;...
0
votes
1
answer
18
views
JPA Mapping : Embeddable Composite Key and Mapping issue
My DB Structure is as follows :
Table : product
prod_id
...
Table : product_category
prod_id
category_id
...
Product_category has Unique contsraint on (...
0
votes
0
answers
11
views
Title: Issue with Insert Statement Generation for @ElementCollection Mapping in JPA
I'm encountering difficulties with generating insert statements for an @ElementCollection mapping in my JPA entity. Here's a summary of my setup:
I have an entity class CustomMeal that extends another ...
0
votes
0
answers
39
views
Hibernate - Mapping only id not entire entity with foreign key constraint
Hi want to create a foreign key association/constraint but only map the primary key, not the entire entity. So what I want to achieve is something like this (which creates the correct db schema but ...
0
votes
1
answer
35
views
Is there an option in intellij to generate tables from our classes (entities)
How to generate database tables from entity classes with jpa hibernate. Using the IntelliJ IDE.
Because I created my entities with the jpa annotations, I also created the data source and tested the ...
0
votes
1
answer
294
views
How to conditionally join with field's value of a entity by JPA or Hibernate annotations?
How do I fetch entity informations depends on a field value ?
@Entity
@Table(name = "transaction")
@Getter
@Setter
@ToString(callSuper = true)
public class Transaction {
@Id
@...
0
votes
0
answers
25
views
Parallel Calls for child level tables from parent repo itself
We're using JPA + Hibernate with our Hana database. Below is the db model as such..
VehicleModel {
salesModel
financialModel
maintenanceModel
}
*
Now the repository is at Master entity Vehicle and ...
0
votes
1
answer
37
views
@NamedEntityMap does not seem to work in Wildfly 30.0.x
I am trying to use EntityGraph to avoid using fetch=FetchType.EAGER:
EntityGraph<?> graph = entityManager.getEntityGraph("parent.hierarchy");
Map<String, Object> hints = ...