Category "hibernate"

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 {

Spring Data JPA with hibernate annotations

We have a large code base using Hibernate and JPA with hand-made DAO Layer. Entites are mapped with JPA annotations (javax.persistence) and if needed, hibernate

Lombok - Hibernate @OneToOne in same class - StackOverFlowError

I'm working with 2 tables: Person and City. I have a @ManyToOne relationship which worked fine. (many persons can belong to one city). Then I needed to create a

JPA OneToMany / Parent - Child: can the child hold the parent ID alone?

I am a bit confused about bidirectional parent-child relationships. I have entities like so: Foo -> Parent -> List of Child Bar -> Child if I have on t

Is it possible that the changes made by a transactional method are visible in database before the transactional method ends

Two Spring boot (spring data jpa) Application A1 and Aplication A2 both read/write to a table named T1. T1 -> ID, data1, isDeleted columns My requirement is

How to configure Spring Boot entity for GeoJSON?

I want to save a GeoJSON to database by using Spring Boot and JPA Example JSON object: { "type": "FeatureCollection", "features": [ { "type":

How to check spring boot post API if it is available in the database

**Controller** package com.example.curd.curdtesting.controller; import com.example.curd.curdtesting.entity.Book; import com.example.curd.curdtesting.service.Bo

After update to spring boot 2.6.3 from 2.5.X hibernate does not work in some query syntax

someone could help me to solve this bug? i have update spring boot from 2.5.x to 2.6.3 and now the query like: @Query("select count(s.subjectId) from PreChe

java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped

I know this has been asked many times, but none of the answers have solved the problem so far. My code was working perfectly for years up until I upgraded from

Using Enum values in @Query JPQL and @CreationTimestamp hibernate

I am stuck with some problem about using JPQL with spring data Here is my code snippets @Entity @Table //... public class Parent { @Id private Stri