Category "jpa"

Spring boot mapsId

Hi I using spring boot jpa and I need to use mapsid. There are not so much information about that and I wonder if anyone can help me understand how to use maybe

What is the best practice for solving the number of cases of N searches in Spring JPA?

What is the best practice for solving the number of cases of N searches? There are 3 search conditions for me. There are search conditions of A, B, and C. In th

Proper mapping ( JPA ) composite key

For example i have entities @Entity public class A{ @Id Long Id; ... } @Entity public class B{ @Id Long Id; ... } @Entity @IdClass(ABId.class). public class AB{

Select only a set to improve perfomance

I search to know if a user have an active subscription @Query("select case when count(u) > 0 then true else false end from User u where u.id=:userId and cur

EntityManager closed when executing queries on different threads

I am trying to execute a couple of queries on different threads. There are 2 top level queries each executing on different tables at runtime. For executing the

SQL inner join with top to JPPQL

I have this SQL: SELECT b.NAME, b.ID, hc1.CATCH_DATE, hc1.id FROM BIRD b INNER JOIN HEALTH_CHECK hc1 ON hc1.BIRD_ID = b.ID INNER JOIN (

DB default column value null while saving with Spring Data JPA

I have a JPA entity with the following fields: @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "modified_by_user_id") private User modifiedByUser; @Conve

JPA relationship for existing table and parent table

I have a table which has a foreign key relationship with an existing table and its child table. The parent table exists before the child table as is populated

JPA/Hibernate @GenericGenerator throws StackOverFlow on persisting entity

I have implemented two entities (Department and Employee) with custom ID generator for Employee, and has a unidirectional one-to-many relationship as shown belo

Can I set readOnly false when I use findById with JPA

I have a problem with modifying data while setting database replication Before DB replication, I get data that I want to modify using repository.findById() and

It's seems hibernate ignores allocationSize

I'm trying different hibernate id generation strategies and I've noticed that it seems like hibernate ignores allocationSize. I have the following entity class:

Hibernate - Map View to Entity - view is not mapped [SELECT la FROM ListAgent la]

In an effort to power an autocomplete, I resolved to map a PostgreSQL view. I followed a tutorial for this. It seems that it does not work at all : I've always

Inconsistency between postgres and hibernate

Inconsistency between hibernate and postres. Consider we have table student having 2 columns id(Primary Key) and name. Perform the following concurrent query on

JPA cascading delete fails with custom delete method

I ran into an error with custom delete method in spring data jpa. Basically there's a bag which contains items, and when deleting the bag, all the items in it s

spring boot transactional integration for event management

We have recently put a REST Spring Boot MVC application into production. We are using JPA with Postgresql in order to achieve some nonfunctional requirements: w

spring boot transactional integration for event management

We have recently put a REST Spring Boot MVC application into production. We are using JPA with Postgresql in order to achieve some nonfunctional requirements: w

Is there a way to get the EntityManagerFactory on a project that uses Java Spring JPA but doesn't have a "persistence.xml" file?

I want to use the EMF to do queries constructed at runtime on a String. If there is a way I would appreciate it if someone could tell me how and give a small ex

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

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

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