369 questions
2 votes
0 answers
121 views
Hibernate 6 native query on parent class fails with “ORA-17006: Invalid column name”
After upgrading from Hibernate 5 to Hibernate 6, a native query that used to work now fails with an “ORA-17006: Invalid column name” error. Entity definitions Base class: @Entity @Table(name = "...
2 votes
1 answer
154 views
JPA repository method with native query containing '&&' works with Long[] but not Collection<Long>
In one of my Spring Data JPA repositories I have this native query (PostgreSQL): @Query(value = "SELECT * FROM ballots b WHERE b.companies && :companyIds and b.meeting_id in :meetingIds&...
0 votes
0 answers
59 views
How to map additional aliased columns from a native query to a JPA entity when the column does not physically exist?
I have the following Spring Data JPA repository method using a native query with an aliased column that does not exist physically in the database table: @Repository public interface ...
0 votes
0 answers
56 views
Kotlin + PostgreSQL native query returns inconsistent results compared to DBeaver with same parameters
I'm executing a PostgreSQL query in Kotlin using prepareNativeQuery and passing named parameters like this: prepareNativeQuery(sbConsulta, Tuple::class.java) .setParameter("UNIDADE", ...
1 vote
0 answers
48 views
Why Spring JPA trying generate query for native query?
I made a native query: @NamedNativeQuery( name = "getting_some_objects_native_query", query = "some query", resultSetMapping = "some_object_mapper"...
1 vote
0 answers
92 views
SQL Server built-in functions in H2
I'm working on a Spring Data JPA application that connects to SQL Server and uses H2 for integration testing (JUnit). I have a native SQL query that uses the SQL Server DATENAME function, like this: ...
0 votes
1 answer
39 views
Hibernate 5 native query maps wrong values to columns
Hibernate 5.6.15.Final I have 2 entities with 1-to-1 relationship, both have audit fields "createdBy", "modifiedBy", "createdDate", "modifiedDate". class ...
0 votes
1 answer
377 views
How to bind UUIDs as VARCHAR parameter in a native query?
I'm adding a new column - uuid with varchar(36) type in Oracle DB. I had a search query that searched by ids, now I need to add a similar query but using uuids instead. @Column(name = "UUID")...
0 votes
1 answer
212 views
Named and indexed parameters do not work in EclipseLink with Spring Boot 3
I'm trying to use EclipseLink as a JPA provider in a Spring Boot 3 app. I seem to be missing something, as Query.setParameter() is not able to set named (:param) or enumerated (?1) parameters. This ...
0 votes
1 answer
104 views
Duplicate key error when doing INSERT with JPA native query
I am trying to run a JPA native query which will INSERT data in a postgres database. However I am getting the following error : Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value ...
1 vote
0 answers
37 views
batch for update entities list by NamedQuery and function with Pair as input
I've found very interesting but not implemented method in some CoreDao Interface: import org.apache.commons.lang3.tuple.Pair; import javax.management.Query; import java.util.List; import java.util....
0 votes
1 answer
90 views
space is not allowed after parameter prefix ':' in SpEL support in Spring Data JPA @Query definitions
I need to update the values into update native query from EmployeeDTO class and I have used following implemetation. But I got this error in console, even though the syntax is correct for query: ...
0 votes
1 answer
238 views
Elasticsearch Nested Aggregations with Spring data elasticsearch 5.2
Help Needed: Perform a Nested Aggregation with Spring Data Elasticsearch 5.2.6 and Elasticsearch-rest-client 8.10 I'm working on a project using Elasticsearch with Spring Data Elasticsearch 5.2.6, and ...
0 votes
0 answers
72 views
Firebird Hibernate Dialect generates CONCAT, which is not valid syntax
Specification: Firebird 2.5, Hibernate 6.2 or 6.5 - yes I know this is odd composition since Firebird 2.5 is pretty outdated but for a while I have to live with it. When I call custom method in ...
1 vote
1 answer
187 views
Firebird Hibernate dialect misplaces first ? and skip ? parameters in statement
Configuration: Firebird 2.5, Hibernate 6.2 or 6.5 When I call custom method in PagingAndSortingRepository with Pageable object set to page > 0 the generated statement has misplaced first and skip ...