Query on parent’s collection – Hibernate Specification

I have three tables created with Hibernate. Product is the parent while barcodes is a collection end price is a child (one to many) of products. @NotBlank private String ref; @ElementCollection(…

It’s possible to use JsonIgnore when my lazily initialize is failed?

I search one way to use JsonIgnore (or just return an empty array) when my assotiation variable with fetch = FetchType.LAZY isn’t initialize and use my own serializer when it is. I tryed to do test in …

Hibernate – Error accessing stax stream – with hibernate.properties

I’m getting this error : INFO: HHH000205: Loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.dialect=org.hibernate….

Saving new entity with JPARepository throws InvalidDataAccessResourceUsageException: could not extract ResultSet

Currently working on a REST API with Springboot + JPA/Hibernate + Oracle. I have an entity called Foo linked to a Bar entity with @ManyToOne (Mulitple Foo can have one Bar). When I send an HTTPS GET …

JPA duplicate entries on child when update parent several times

I am building the Rest API with Java, Spring Boot, Hibernate and JPA. I have 2 tables Users and Friends, where User will have an array of Friend. My client will send several update request on my User …

JPA Criteria builder for dynamic query

I have to write a method where I pass it some arguments and depending on which arguments are empty it modifies the query I need to execute at the end. E.g. if I want to select from a table Customer …

1:n disable constraints for the n-side?

The Problem I have a 1:n relation, but the n side shouldnt rely on constraints. So i actually wanna insert a EntityPojo via its future id, when its not saved yet ( Lets ignore that its a bad practice )…

How to create hibernate request with localdate

I have a user who has an expiration date (dateTime), I need to display all users who have not expired yet. Tried different options with DATA (), or as an example – @Query (name = “SELECT u FROM …

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast or BeanUtils.copyProperties not working

am new to JPA and springboot unable to get the api response when am using @Query param(I try achieve the inner join) Repositoty class: @Transactional(rollbackFor = Exception.class) @Modifying …

Error accessing field by reflection for persistent property [model.Credentials#email] on @EmbeddedID

I’ve been experiencing problems implementing the Authorities on my spring boot application, and after digging a little I realised that maybe the association between my Credentials and Authorities …