Category "hibernate"

Bi-directional relation in hibernate is failing to be cascadelly saved

I am using a Spring-Boot (2.3.3) application with Hibernate (5.4.20) and JPA repository on MySql DB, and I have a Bi-directional relationship between an entity:

Error creating bean with name 'entityManagerFactory' caused by java.lang.IllegalStateException

In the code I do not even use entityManagerFactory. I extend JPARepository and for creating the tables I have entities annotated with @Entity (using javax.persi

Nesting one-to-one relationship in already owned entity

I'm working on a project with multiple user data mapped to a user by one-to-one relationships in the entities. I'm in the process of adding another entity which

What is use of the annotation @JsonIgnore?

I'm joining tables with one to many cardinality, the classes I'm using refer to each other. And I'm using @JsonIgnore annotation with out understanding it deepl

Spring JPA alter table by creating extra column

I am implementing Spring-JPA application . In the model class I am using @Table annotation to map the table with the model class and against the column name usi

Replacement for Hibernate's deprecated Type annotation?

Upon upgrading to Hibernate 5.6.0.Final, I found that org.hibernate.annotations.Type is now deprecated. I use this annotation in many of my entities, including

Results of group by null values are lost

I have table which has productId and productVariantId columns. |id |userId|productId|productVariantId| ---------------------------------------- |1 |1

How to use ilike and % in createSQLQuery in hibernate java

I have made a sql query now i need to add search from it. it needs to search from userfullname the given keyword query is working in postgresql but it is not wo

Quarkus upgrade complaining regarding vertx thread in tests

I have recently upgraded quarkus to 2.9.0.CR1 and am now having issues in some of my tests I am using reactive panache in this, through the repository pattern.

Hibernate PessimisticLockingFailureException Occurring at a particular time everyday

I have a Spring Boot application and hibernate exception comes every day at a particular time at night. The exception is : could not execute statement; SQL [n/a

Strange queryplan jumps on partitioned table on old postgres 9.3

Our solution: We have a trigger based partitioned table. BUT the insert trigger return NEW because hibernate must have rowcount 1 so all insert is inserted pare

java.lang.NoSuchMethodError: 'java.lang.String org.hibernate.search.engine.Version.versionString()'

I'm having a problem trying to upgrade hibernate search from v5 to 6.0. I had it working previously but now I'm getting the following error no matter what I do

How Hibernate process '?' [duplicate]

I'm new in Hibernate. I can't understand how Hibernate process ? in Restrictions.sqlRestriction() method. For example, there is a sample from

How can we test for the N+1 problem in JPA/Hibernate?

I have a N+1 problem, and I’d like to write some kind of automated regression test because it impacts performance very much. I thought about spying the E

How to make DataJpaTest flush save automatically?

I have an Employee entity with the following column: @Entity class Employee { @Column(name = "first_name", length = 14) private String firstName; and I hav

Missing table [rev_info] after bump liquibase version, spring data envers

I have problem with my project after bump liquibase version to 4.9.1. There is error: BeanCreationException: Error creating bean with name 'entityManagerFactor

problem with postgresql sequence and hibernate

I often read this site, but this is the first time I write, hope I won't make mistakes and apologize for my bad english. I get to the point: I have to develop c

Hibernate createNativeQuery returns duplicate rows

I have 2 database tables Customer and Items with 1 -> many relation. To fetch data from database i am using the following query. select customer.id, cust

Hibernate 5 migration Issue with Multilevel Joined table Inheritance with Hibernate 5.4 DiscriminatorColumn

I am working on migrating a legacy Hibernate project from version 4.1 to 5.4. The code has Multilevel Joined table inheritance using a dedicated DiscriminatorCo

Set of String is not acting normal in Spring JPA Projection Interface

I am using Projection Interface to return a partial view of an Entity, and the partial view contains a Set of String. I expect the Set works as normal but its n