Questions tagged [jpa]
The Jakarta Persistence API (formerly Java Persistence API) (JPA) is a Java specification for accessing, persisting, and managing data between Java objects/classes and a relational database. JPA was defined as part of the EJB 3.0 specification as a replacement for the EJB 2 CMP Entity Beans specification. JPA is now considered the standard industry approach for Object to Relational Mapping (ORM) in the Java Industry.
52,175
questions
0
votes
0
answers
11
views
JPA @Procedure multiple out parameters
Here is my working code:
public interface CandidatRepository extends JpaRepository<Candidat, String> {
@Procedure(procedureName = "garnuche.INSCRIPTION_TEST")
...
0
votes
1
answer
32
views
Why does enum cause type mismatch when saving in postgresql from JPA?
I have a user object defined as such
@Entity
@Table(name = "user_account")
public class User {
public enum Role {
CLIENT,
ADMIN
}
@Id
@GeneratedValue(...
0
votes
0
answers
6
views
How/where can I configure the JPA query used for a nested collection property?
I'm rewording (hopefully simplifying) my previous question as it got no response.
When a Parent Entity contains a List<Child> property, how can I control/configure/override the default Parent ...
0
votes
0
answers
9
views
Workaround for using DetachedCriteria with JPA & Hibernate-6?
In my org, many applications heavily depend on the DetachedCriteria of Hibernate.
The application sends DetachedCriteria to the library which internally uses hibernate sessions and sends the result ...
0
votes
1
answer
15
views
Why Join attribute appending with join column?
I have two entity
@Entity
@Table(name = "Student")
class Student{
@Id
@Column(name = "Id")
private Integer id;
@Column(name = "name")
private String name;
@OneToMany(...
0
votes
0
answers
20
views
Joining Entities by a Range - Hibernate
I have a question regarding Hibernate that's been bothering me for some time.
Consider I have two entities:
@Entity
public class Statement {
@Id
@Column
private int id;
@Column
...
1
vote
0
answers
25
views
Column <name> is of type json but expression is of type smallint[]
There is field of json type in postgres db named data_processing_steps.
It's defined in category entity as
@Type(JsonType.class)
@Column(columnDefinition = "json")
private Set<...
0
votes
1
answer
16
views
How to reduce time taken by createEntityManagerFactory
I'm setting up unit tests for my company application. It's set up to create a new docker container of the database for every test, so each test has a fresh database to work with. However, I get an IO ...
0
votes
0
answers
9
views
record content lost with jooq 18 + spring boot 3.2 + jpa annotations [updated]
I'm working on a small tutorial project that will have both jooq and various spring database implementations. The idea is to demonstrate a core module with nearly everything plus minimal, easily ...
0
votes
0
answers
37
views
JPA repository findBy return different result when using H2 and MySQL
This is the simply version of my application.
I have 2 entity.
Customer.java
package com.udacity.jdnd.course3.critter.user;
import java.util.List;
import java.util.ArrayList;
import com.udacity.jdnd....
0
votes
0
answers
16
views
[spring-boot]open api can't be stored in mysql database
bonjour,
I have a unsolvable problem ... help me
I downloaded XML open api file and parsed that in spring boot.
Even though mysql db was successfully connected, data wasn't stored in my db table.
Only ...
0
votes
1
answer
49
views
JPA entity ID field with a SQL Server 2022 Sequence
I am trying to connect my Spring Boot service to a SQL Server 2022 database, but I am having issues with a sequence:
public class SomeEntity {
@Id
@SequenceGenerator(name = "some_seq"...
-2
votes
0
answers
38
views
Create Docker container with both mysql and tomcat [closed]
I've been trying to build a tomcat-mysql docker container for days but I've run into some problems.
I've come to realize that, once built, it doesn't seem to be able to find my resources path in the ...
1
vote
0
answers
20
views
Reuse javax.persistence.criteria.Join inside Specification class
for ilustration purposes, lets say I have a Student table with some data and one School table . The Student table has a Foreign Key to School table. Using Spring data I have something like this:
@...
0
votes
1
answer
23
views
Spring JPA JoinTable
I have three entities. I want to save a survey. The survey will contain all the data that is neccessary:id,section, questions.
The survey_section_question table is created successfully and when I want ...