All Questions
4,496
questions
-2
votes
1
answer
35
views
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: USE
I have a query that is trying to grab a number of details from a list of defects:
String useIndexPrimary = "USE INDEX (PRIMARY)";
TypedQuery<Defect> query = getEntityManager()....
0
votes
0
answers
27
views
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'track_SEQ'
Getting this error after upgrading spring to 3.1.5 version & java 17 from 2.x with & java 8.
DB connection is okay and all queries are executed as expected except for repository.save() query
...
-1
votes
0
answers
20
views
Hibernate performs redundant DB call to fetch child entity data along with parent during refresh event which is already fetched
I am using Hibernate 5.6.15. Hibernate performing Cascade Refresh of the associated child entities and then use LEFT OUTER JOIN on the parent entity with same child entities and fetch them again
I ...
0
votes
1
answer
24
views
Entity Inheritance and query filtering
I'm trying to achieve a very basic from SQL point of view operation but using Spring Boot and JPA
This is my Java data model:
@MappedSuperclass
public abstract class BaseEntity {
@Id
@...
-1
votes
0
answers
21
views
Hibernate HQL query validation error for join-fetch with conditional logic
I'm encountering an issue with a Hibernate HQL query where I'm trying to use conditional logic within a join fetch clause. Here's my query and entity setup:
I have two entities LovMst and LovVal with ...
0
votes
1
answer
59
views
Why boolean values are not set properly in DB
Here I'm trying to set Boolean values using JPA but in return the field name and the value both are different from what I have actually passed.
If you look at my request, I have passed isCouponAplied ...
0
votes
0
answers
38
views
How to Create a Composite Key Using Two Fields in JHipster?
I am learning JHipster and trying to create a relational table where the primary key is a combination of two fields. In the Liquibase changelogs, it looks correct, but when I run ./mvnw -Pdev, it ...
0
votes
0
answers
21
views
Criteria Builder Sort a Table before Joining?
I want to join multiple tables, but I wanted the first record of the last id. So I want to join Table A and Table B, sort that by Table B's Id in DESC order then join it to Table C.
CriteriaBuilder cb ...
0
votes
0
answers
45
views
Use list of tuples as parameter in Quarkus Panache named query
I have the following (working) SQL query (names are changed for better readabilty):
select B.a, A.a, A.b
from A
inner join Bb ON A.b_id = B.id
where (A.b_id, A.c_id) in ((13, 113),
...
0
votes
1
answer
38
views
Using @SqlResultSetMapping to map to list
Person
ID
Name
1
Luis
2
Frank
Address
Person-ID
Address
City
1
Samantha Road
x
1
Franklin
y
In my Hibernate native query I want to map the result of one person to a set of addresses, such like ...
0
votes
1
answer
14
views
Hibernate ReturningWork - how do I print sql generated by ReturningWork?
How do I print the queries generated by Hibernate ReturningWork. As it uses jdbc connection the queries are not printed in the logger file after setting org.hibernate.SQL to INFO. May I know what ...
0
votes
0
answers
49
views
Generate Native Query with JOOQ and Map with Hibernate
Is it possible to generate a native query with jooq and use hibernate to do the mapping? I am generating the exact same sql that hibernate shows with print-sql: true, but am still getting org....
-1
votes
2
answers
42
views
filter on union entities with JPA specification
Considering this java JPA model:
@Entity
@Table(name = "PARENT")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class ParentEntity { }
@Entity
@Table(...
0
votes
0
answers
17
views
1 When I run my pgm class I get the following error:
1 When I run my pgm class I get the following error:
Apr 22, 2024 8:45:54 AM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate ORM core version 5.6.5.Final
Exception in thread "main&...
0
votes
1
answer
72
views
String formatting with object parameters in intellij
I am creating a standard function that uses jpa's createQuery function, as it will be a generic class, I can format the sql elsewhere, but when using the same pattern and definition of parameters only ...