Category "jpa"

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

Using EntityGraph with SuperClasses and Embedded Attributes

I would like to use the EntityGraph Feature because of the known n+1 Problem. I have the following Entities structure: @Entity @Table(name = "customer") public

How to do a get request to SpringBoot java with an Array<Array<string>>?

I am doing a get request in angular with typescript and here it is: this.http.get("http://localhost:8080/data-management/data-users/getAllGeneralInfoCV/"+this.l

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

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

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":

Truncating, Selecting data from multiple tables using joins and then inserting data into separate table in spring boot

I am using a spring boot application. I have multiple tables and using inner joins, I want to populate a temp table. Before populating, I have to truncate the t

How to remove foreign key without deleting the whole entity

I am new to Spring boot and I want to be able to delete the value of a forgein key if its entity is removed without deleting the whole entity linked to it; I ex

How to handle 2 OUT user-defined custom data types from Java Spring Data JPA @NamedStoredProcedureQuery defined on @Entity class?

UPDATE: I have tried implementing the SQLData interface for my Financial.class and PersonalInfo.class Java POJOs defined on my @NamedStoredProcedureQuery for th

SpringJPA convert DB2 Negative Numeric type in Positive number

I'm using Spring Boot with JPA and a Db2 database on an AS400 server. When I inspect the result of a SELECT statement using the debugger tool, the value stored

Jpa reader Spring Batch

I would like to know, if this way is recommended to implement the reader spring batch with jpa or is it better to look for another solution and if this way is n

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

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

Fixing of Java.lang.IllegalStateException: No active conversation found. at com.rapidclipse.framework.server.jpa.Jpa.getEntityManager(Jpa.java:200)

I have a running RapidClipse X Project, in which I work with a MySQL Database. I created a class to copy data from one table into a second table. For this I use

Criteria API join with filter

So I am trying to replace the following native SQL with JPA Criteria Api: select CAT.* from CAT join OWNER.ID = CAT.OWNER_ID where OWNER.NAME = :ownerName or s

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

i am getting "Could not create query for public abstract void "jpa error when i am adding dbname to table

error : 2022-05-06 11:26:09.621 ERROR 38049 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed org.springframework.beans.fa

java.lang.NullPointerException: Cannot invoke "java.lang.reflect.AccessibleObject.setAccessible(boolean)" because "ao" is null

I am doing Dynamic Web Project using JPA in Java 17. I have a class called UserEntity. In the first page I have a register button, which has the following funct

How to properly use JPA/Hibernate?

I'm trying to understand annotations better with JPA / Hibernate and SQL Server. I created a simple project: an abstract class named "Articles". Two classes inh