Category "hibernate"

In DB MySQL the index already exists for the column, should I add the index in the Hibernate Entity?

If the column has already the index "INDEX_VALUE" in DB MySQL. Do I still need to add in hiberante Entity? @NamedQuery(name = "", query = "SELECT e FROM Entity

JPA Hibernate OneToOne children enity always fetches parent entity

I am having a problem with a OneToOne relationship. Trying to load a children entity will always result in an additional query that loads its parent, even if I

Why Hibernate cant create DB? SQLSyntaxErrorException and CommandAcceptanceException

I have three DBs, of which hibernate can only create 2/3. Can someone explain why hibernate can not create a third table "goods" 1: org.hibernate.tool.schema.sp

How can we assign a field of user table say id that is primary key, to another table as a primary key? using hibernate

See I dont want any mapping but what I want is just a simple thing that is.... I have two Entity Tasks(taskid,taskname.....,userId) User_Credentials(userId,pass

Spring: Not-null property references a null or transient value

I have an entity(Car) and i want to add records belong this entity with postman. My entity has one relational connection with User entity. When i want to add a

How can I do a loop "do/while" to insert some data to Postgres Database?

I did this class to do the inserts but every time I need insert again, I need initialize the method main of this class again. Because it is in just one cycle. p

java.sql.SQLException: Column 'serialnumber' not found. (spring boot)

I am writing to-do list web app with spring boot. I Have 2 entities: User (fields: userid (ID), username, password Item (fields: serialnumber (ID), task, userid

Hibernate produces broken query

I have an entity that is mapped to the database table by Hibernate: @Entity @NoArgsConstructor @Getter @Setter @FieldNameConstants public class Set extends Abs

First time SQL query is taking More time from Spring Boot application

I have to fetch some records and then display in output. In my Spring Boot Application, I am using JPA Specification for creating Criteria and then calling repo

Hibernate : functionnally calling hibernate to recreate constraints

I have been deferring my hibernate DDL usage time after time, from create-drop, to update and now i'm using other tools for database migration, and, while still

JPA/Hibernate: Named Query vs Native Query | Which one to use?

There is native query written by developer String sql = "Select * from TERP_META where id=" + id + " and type='KCH' ORDER BY ID ASC"; return entityManagerMaster

Is there a @LastAccessedTimestamp in JPA

I want to store the last read time in a Date column when ever someone tries to load or fetch(select query, findBy methods) a entity I had a look at @PostLoad as

Are query results cached by Java/Hibernate?

Our codebase has a lot of examples of the following code: singleResult = q.list().isEmpty() ? null : q.list().get(0); and I'm currently in the process of repla

Are query results cached by Java/Hibernate?

Our codebase has a lot of examples of the following code: singleResult = q.list().isEmpty() ? null : q.list().get(0); and I'm currently in the process of repla

Why get 403 Forbidden while click on login [duplicate]

I am working on Spring MVC project. I use Spring Security for secure the url of my project. While i click on login button login succesfully bu

Hibernate envers revision throws exception when use @OrderBy

I have 2 entities and use Hibernate envers and Spring envers for auditing @Data @ToString(exclude = {"groupReportPrices"}) @EqualsAndHashCode(exclude = {"groupR

Error creating bean with name 'entityManagerFactory - nested exception is java.lang.NullPointerException

I'm only learning Java and Spring and after several projects/tutorials went well I'm stuck with this error on a new project: org.springframework.beans.factory.

Using custom function call in CriteriaQuery multiselect cause a null pointer exception

I have a spring boot based application with hibernate-types included to properly map Postgres array to JPA entities. It works fine, but I run into an issue when

Distribute cache between Pods in Kubernetes with Hazelcast in Spring boot application

I have a Spring boot application with Hibernate L2 cache enabled. I integrated Hazelcast as cache provider for Hibernate. My application runs on Kubernetes and

joinColumns in Hibernate for standard relations?

In the following example, there are 3 entities which have relations e.g. @ManyToMany, @OneToMany and @ManyToOne: Student: @Entity @Data public class Student {