Category "hibernate"

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

Saving large files in h2 database

I recently updated the h2 database in my springboot project to 2.1.210. This induced some problems, most of them I was able to fix myself. The one that I can't

Saving entity with Spring JPA Repository resets enum ttype value

I have an TimelineEntity entity, that uses HoTimelineType enum with custom integer value. That custom integer value is stored in the database. Implemented via U

Can subgraph reference another named entity graph?

So I have found a few answers where one says it is possible to do so and the other says it is not. This kind of confused me because when I tried to do so - I fa

@Transactional on @Async methods in Spring Boot with shared object

I have a requirement where I have to save a lot of data into an Oracle DB. I want to use multithreading to speed things up. Everything is in a transaction. I ha

Hibernate Jpa: update on @Embeddable table generates a query using the wrong table which @Embedded

I have the database tables Person and Details. Details are intended to carry the miscellaneous fields for the Person using the foreign key PERSON_ID. JPA code h

Error creating bean with name 'securityConfig': Requested bean is currently in creation:

package ro.contabilitateexpert.AccountExpert.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotati

How to retrieve MySQL column content stored as mediumblob?

In a project that was passed on to me there is a MySQL database that is used to store lots of data. Each database has a table that contains lots of text snippet

Hibernate GROUP BY results in syntax error

My Hibernate query is: SELECT M.uid, P.userUid, COUNT(*) FROM PostXMentionsEntity M JOIN PostsEntity P GROUP BY M.uid, P.userUid ORDER BY COUNT(*) DESC where P

EntityManagerFactory is initialing

I`m DONT use EJB/Spring etc. Only Jpa + Servlet. I`m trying to create public abstract class AbstractEntityManagerFactory { private static final EntityManagerFac