95,108 questions
1
vote
1
answer
38
views
Spring Boot 4 upgrade hibernate jpa json functions incubated
When upgrading to Spring Boot 4 (Hibernate 7) you can get the message that the json functions are incubated, i.e. default its turned off. It will then tell you to set hibernate.query.hql....
1
vote
1
answer
40
views
CrudRepository List<T> query of parent entity T with OneToMany child entity returns a lazy list of parent entities
Can someone explain to me the following behavior I'm seeing. I have the following simple setup.
@Entity
public class Contract {
@Id
private Long id;
//...
@OneToMany(mappedBy="...
1
vote
0
answers
105
views
How to find fragment interface generic type
I am trying to create a custom generic repository using the fragment interface approach as described in this article: https://docs.spring.io/spring-data/jpa/reference/repositories/custom-...
-1
votes
1
answer
150
views
Failed to initialize JPA EntityManagerFactory: Unable to build Hibernate SessionFactory
I'm new to Java programming and while trying basic programming, I tried to connect java with Mysql Db where i am facing below issue,
Failed to initialize JPA EntityManagerFactory: Unable to build ...
1
vote
1
answer
58
views
Protecting entity related data from database initialization
I have a Spring Boot application accessing a database having schemata A and B, employing JPA and Hibernate, all entities but one are controlled by me (I can modify them and update their data).
...
2
votes
1
answer
78
views
Replacement for deprecated Hibernate Criteria .list() and .scroll()
I was on Grails 3.3.18 and I’m migrating to Grails 6.
Since upgrading, I get this warning in my logs:
org.hibernate.orm.deprecation - HHH90000022: Hibernate's legacy org.hibernate.Criteria API is ...
0
votes
0
answers
98
views
How to optimize a complex insurance quotation workflow with multiple dependent validations and API/database calls?
I’m working on enhancing a life insurance quotation workflow using Spring Boot 3 with JPA/Hibernate.
The workflow involves several dependent steps:
Customer eligibility checks
Product → Plan → Rider ...
1
vote
1
answer
115
views
Hibernate: How to keep PostgreSQL enum type up-to-date with Java enum?
I'm building a Spring server program which uses a PostgreSQL database. For one of the table columns, I want to restrict the possible values to a static pre-defined set, so I created a PostgreSQL enum ...
0
votes
0
answers
77
views
Hibernate casts null to the wrong type for the column that is in only one of two tables that are union'd
I have two entity classes that both inherit from an abstract class, and a JPA query that searches through all the entities of both derived classes. The query fails when Hibernate selects null for the ...
0
votes
1
answer
91
views
Hibernate @oneToOne mapping is unable to use L2 cache when mapping returns no Object
I have 2 JPA classes with bi-directional onetoOne mapping :
@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Person {
@Column(name = "\"Name\"&...
0
votes
0
answers
65
views
Hibernate doesn't load attribute nodes with entity graph
I have the next entity three:
TestEntity
/ \
FirstNodeEntity SecondNodeEntity
(LIST, LAZY) (LIST, LAZY)
| \
ThirdNodeEntity ...
2
votes
2
answers
81
views
Testcontainer: H2 is still used in test, Domain "TEXT" not found;
I have a very simple example: the entity uses TEXT column and the test fails because of it, despite using PostgreSQL testcontainer:
application-test.properties
spring.datasource.url=jdbc:postgresql://...
0
votes
0
answers
86
views
Hibernate LazyInitializationException - Cannot evaluate .toString()
I'm migrating from Spring Boot 2.7 to Spring Boot 3 and this means i'm migrating from Hibernate 5 to Hibernate 6.
I'm meeting some LazyInitializationException .
This is part of a entity of mine:
@Data
...
1
vote
1
answer
55
views
Hibernate: Invalid stream header "[-0." when trying to deserialize pgvector embedding into JPA entity
I created a PGvector database:
CREATE TABLE IF NOT EXISTS vector_store (
id uuid DEFAULT uuid_generate_v4() PRIMARY KEY,
content text,
metadata jsonb,
embedding vector(1024),
...
0
votes
0
answers
85
views
Mapping an entity with an embedded key
There is a class with an EmbeddedId.
@Entity
@Getter
@Setter
@Table(name = "indicator_values")
public class IndicatorValue {
@EmbeddedId
public IndicatorValueId id;
@Column(...