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(…

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 …

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 …

h2 database persists data but resets on application start

I have a basic test for an embedded database that I’m trying to get working for a java project. As it stands now I am able to save rows to the database with my entity repository object, and after the …

HIbernate “StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1”

When an existing user makes a request the method first deletes the oldest record before saving the new request. The code below works fine IF the requests don’t come in too rapidly (using an Oracle DB)….

config.ConfigurationException: Could not locate cfg.xml resource [hibernate.cfg.xml]

I am building a hibernate application that creates, modify, and query tables from a database. The project was running perfectly fine without having this error, when I try to run it now I got this …

How to map column with type BIT(24) in PostgreSQL with Hibernate

I have a table with a column which type is a bit (24). I tried to use String and when I try to get this object it maps well, but when I try to save it, Hibernate throws Exception: org.postgresql.util….

JPA Hibernate Annotation Issue

I have three Entities i’m modeling and am having issues with the associated annotations. I basically have a class that I intend on returning to the caller, a nested listed of Project’s and the Project …

Create and use database function with JPA

I want to create and immediatly use a database function in a single sql call. As an example, the following works fine in PostgreSQL SQL Editor : CREATE OR REPLACE FUNCTION pg_temp.get(IN nb BIGINT) …