All Questions
689
questions
0
votes
0
answers
22
views
how can I compare unmodified and mofidied entity values in a custom repository save method
I want to prepare a custom jparepository save method. In this method I want to compare unmodified and modified entity field values and then update the modified entity based on the comparison.
When I ...
0
votes
0
answers
37
views
retriving id directly from entity by not loading navigation property
so I have 2 entites (Product, Category).
Category contains list of products and each product has its own category.
So in database Product table has category_id column that is foreign key of Category ...
0
votes
0
answers
59
views
Faild Test Error creating bean with name 'entityManagerFactory'
Test failed with exception
Error creating bean with name 'entityManagerFactory' defined in class path
resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]:
...
1
vote
1
answer
55
views
Is length of generated column affected by both @Size and @Column annotations?
Having a following property in my entity:
@Setter
@Size(min = 3, max = 255)
@Column(length = 500)
private String xo;
Generated column in h2 database is
CHARACTER VARYING(255)
I expected it to be 500....
0
votes
0
answers
40
views
Why hibernate make so much queries even while using DTO and FETCH TYPE LAZY?
I have Entity class Employee :
@Entity
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
@Data
@Table(name = "employee")
public class Employee {
@Id
@GeneratedValue(...
0
votes
0
answers
18
views
Spring JPA entity doesn't update when i use getReferenceId() in transactional function
The contents of the database do not change despite the normal communication and modification of the contents to be modified through the DTO.
entity code like this
@Getter
@ToString(callSuper = true)
@...
0
votes
1
answer
156
views
Spring Boot bi-directional relationship between two objects @OneToMany and @ManyToOne
I am trying to find a solution creating two objects (Author and Book), which can have bi-directional relationship between them. What I mean is when I try to GET all books:
{
"id":1,
"...
0
votes
1
answer
41
views
How map DTO to Entity without the @GenerateValue field in JPA
I have a DTO class with some field and i'm trying to map DTO in Entity class, in my entity class I have an id field (generate value), but not in DTO because i don't need to set a ID.
I have a DTO ...
0
votes
0
answers
21
views
Joining 2 Entity in Spring Data JPA [duplicate]
Hibernate why don't use JOIN in sql query on navigation property. (I used spring-boot)
When I used following code two times SELECT query running. I expect it to do it in a single sql statement.
List ...
0
votes
0
answers
601
views
error org.hibernate.query.sqm.UnknownEntityException: Could not resolve root entity
I Create project based on my older project before.
with new version (Hibernate 6.3.1 Final and STS 4.0)
I try to get data and put on list which is what I usually do in older version.
My adapter:
...
0
votes
1
answer
750
views
How to use dynamic schema names and table names in an Entity class in Java when using Spring boot JPA
This is the query I have
"SELECT * FROM " + billerInfo.getSchema() + "." + billerInfo.getPaymentTable() + " WHERE STATUS='S' AND BILLER_NUMBER=" Instruction.setString(...
0
votes
1
answer
694
views
Spring Boot does not recognize my JPA entity in a specific package
I am using Spring Boot and facing an issue with my JPA entity not being recognized as a managed type. I'd appreciate any help to solve this problem.
[ERROR LOG]
2023-10-08T23:13:04.005+02:00 ERROR 68 -...
0
votes
0
answers
20
views
I can't see the result of EntityGraph. Is it still working?
I tried to check how EntityGraph works in java ee, but after trying many options and various Persistence Provider, I did not see the result of its work. I tried lazily loading related entities and ...
0
votes
2
answers
2k
views
Read Data from MariaDB with SpringBoot JPA
I want to try out a simple Spring Boot Hibernate example.
I have this Database:
create or replace table treasurelog.categories
(
id bigint auto_increment
primary key,
name varchar(20)...
0
votes
0
answers
24
views
JPA one-to-one relation not updated to A when saving B
I have two entities with one-to-one -relation
// simplified pseudocode
public class EntityA {
@OneToOne EntityB entityB;
}
public class EntityB {
@OneToOne EntityA entityA;
}
Failing ...