Skip to main content
0 votes
2 answers
113 views

In my application I want to find the latest duty of each user from 'StaffDuty' table using hibernate query (i.e. HQL). Below is my query. query = session.createQuery("FROM StaffDuty where deptId....
KJEjava48's user avatar
  • 2,073
0 votes
1 answer
26 views

I have a Task with a @ManyToMany referenced roles, which specify roles a user must have at least one of, to perform the task. The HQL search should therefore find all tasks that have at least one of ...
Matthias Ronge's user avatar
0 votes
0 answers
14 views

I am creating an enablePackage API code flow in JAVA. I am using the Spring MVC project. I am facing an issue related to HQL query returning null. The code logic is as follows: Foo.class List<...
Kartik Wanjari's user avatar
3 votes
1 answer
226 views

I'm running a JPA non-native query, which returns a custom object. @Query(""" SELECT new path.to.CustomObject( t, (select id from users where name = :param1) ...
Marco Frag Delle Monache's user avatar
0 votes
1 answer
188 views

i'm trying to register a PostgreSQL custom function in Hibernate 6.x so that I can use it directly in JPQL, without relying on native queries. Scenario I have a PostgreSQL SQL function that returns a ...
Oscar Fanchin's user avatar
0 votes
0 answers
42 views

I have an HQL query that, every time I run it, throws Antlr.Runtime.MismatchedTokenException: 'A recognition error occurred.'. So far as I can tell, this is because I'm trying to use an entity ...
Tam Coton's user avatar
  • 874
1 vote
1 answer
38 views

I need to convert this query to HQL syntax: SELECT * FROM my_table GROUP BY `name` HAVING MIN(ABS(CAST(202000 AS SIGNED) - CAST(step_id AS SIGNED))) = ABS(CAST(202000 AS SIGNED) - CAST(step_id AS ...
user5260143's user avatar
  • 1,098
0 votes
1 answer
166 views

I am upgrading an spring boot app (spring-boot-starter-parent) from 2.6.1 to 3.4.1. part of that upgrade is related to the upgrade of hibernate 5 to 6 and specifically hibernate core 6.6.4.Final with ...
Tito's user avatar
  • 2,310
0 votes
0 answers
36 views

I have two queries targeting the same table, and I want to determine if the filtering ranges of these two queries intersect, that is, whether the two queries will filter the same data.Even if the ...
the  drugs don't work's user avatar
3 votes
1 answer
53 views

Having a cast like this: SELECT CAST(a * 100000000 as big_integer) FROM Amount WHERE id = :id Generate this SQL: prepareStatement( "select cast(amount0_.\"a\"*100000000 ...
Grim's user avatar
  • 2,163
0 votes
0 answers
61 views

I use spring boot, and I want to add specific days to date column in mysql database on hql query order by clause. But which results error when I tried. I need to get results in the order of adding ...
KJEjava48's user avatar
  • 2,073
0 votes
0 answers
30 views

This is my query It is meant to return the selectedResponse and its next and previous ids. As you can see, the Where clause currently constrains the results. I tried a nested select and CTE, both ...
monandszy's user avatar
2 votes
1 answer
33 views

I have tables in DB and matching entities. I have a table 'products'. Each entry in 'products' has unique 'id' column and 'code', which is not unique, multiple different 'products' may have the same '...
Taserface's user avatar
  • 123
0 votes
0 answers
30 views

According to chapter Using a Constructor in HQL in https://www.baeldung.com/hibernate-query-to-custom-class I should be able to use my DTO constructor in @Query select statement. However when I try to ...
u4963840's user avatar
  • 367
0 votes
1 answer
99 views

Below are some of the tables in my product app where I need to execute a case statement as per the data values. class Payment implements Serializable { @Id @GeneratedValue(strategy = ...
KJEjava48's user avatar
  • 2,073

15 30 50 per page
1
2 3 4 5
338