hql Questions
4
Solved
In my Hibernate JPA Sample code..
public List<AttendeesVO> addAttendees(String searchKeyword) {
TypedQuery<AttendeesVO> query = entityManager.createQuery(" select at from AttendeesVO ...
9
Solved
I want to perform data time operations using hibernate HQL.
I want to add and subtract two dates as well as I want to subtract 1 year or 1 month from a particular date.
How is this possible using...
15
Solved
In Hibernate 3, is there a way to do the equivalent of the following MySQL limit in HQL?
select * from a_table order by a_table_column desc limit 0, 20;
I don't want to use setMaxResults if poss...
Anatase asked 6/8, 2009 at 15:33
1
Solved
I have a Java Spring application with lots of queries, which so far have worked until spring boot 3.2.0.
Recently, after simply changing to spring boot 3.2.1, I started getting this kind of error:
...
Dentilabial asked 16/1, 2024 at 2:52
8
I am executing the following HQL and it is executing properly
String hql = "FROM Employee";
Query query = session.createQuery(hql);
List results = query.list();
Now, I also want to log the sql ...
2
Solved
So How to check if a collection is null in HQL? Simple example:
select * from Book book where title in (:titles)
So if titles is a single variable, I can do
select * from Book book where (:tit...
7
Solved
Please help me understand where to use a regular JOIN and where a JOIN FETCH. For example, if we have these two queries
FROM Employee emp
JOIN emp.department dep
and
FROM Employee emp
JOIN FETCH e...
5
Solved
I'm trying to write an HQL query to grab a list of users that belong to a particular organisation, or any franchisee from a list of franchisees, however hibernate isn't able to parse it. I can't fi...
4
Solved
I have a Spring Boot application and use Spring Data JPA to query a MySQL database.
I need to get a list of courses filtered with some parameters.
I usually use the syntax param IS NULL or (/*do ...
Jacobah asked 3/1, 2019 at 17:17
4
Solved
I am using HQL to get the data inserted exact 21 days from now. Here is my Code
Query queryThreeWeek = session.createQuery("from Users where createdDate = CURDATE()-21");
List<Users> userDet...
6
Solved
I'd like to use Hibernate's criteria api to formulate a particular query that joins two entities. Let's say I have two entities, Pet and Owner with a owner having many pets, but crucially that asso...
6
What is the difference between an INNER JOIN and LEFT SEMI JOIN?
In the scenario below, why am I getting two different results?
The INNER JOIN result set is a lot larger. Can someone explain? I...
6
Solved
I have written a query to delete some objects in my interface extending JPaRepository, but when I execute the query it throws an exception!
Can anyone explain it for me?
Query:
public interface Lim...
Raja asked 17/5, 2017 at 10:19
3
Solved
I want to execute the below query in Hibernate?
select count(*) from login where emailid='something' and password='something'
3
Solved
3
Solved
I have a question with HQL query and hibernate.
I have a user class and a role class. A user can have many roles. So I have a ManyToMany relatation like this:
In user class:
@ManyToMany(fetch = ...
4
I'm working with hibernate and I'm having troubles creating an hql query that fetches all the children of my object.
For example: The Object User has a list of Cars and a list of Friends.
To get ...
3
Solved
I want to get expired entities from table using HQL. Something like that:
select id, name from entity_table where date_creation + 10_minutes < current_time()
I cant get how to do that with HQ...
5
Solved
I need a list with three columns. column 1st and 3rd having values while 2nd as null.
Can I do it through HQL query?
I need something like this:
select id, null, name from MyClass
Where MyClas...
5
Solved
I use the following query to get a java.util.Map with indexes id, text and object:
Query q = mySession.createQuery(
"SELECT u.id AS id, u.name AS text, u AS object FROM User u")
.setResultTransf...
5
Solved
I am retrieving data by CrudRepository in Spring Data JPA. I want to filter my records those are retrieved from my custom query provided in @Query annotation. I tried .setMaxResults(20); for select...
Mcgraw asked 3/12, 2017 at 8:2
3
2
Caused by: org.hibernate.QueryException: Could not resolve requested
type for CAST : INT [ SELECT SUBSTRING(referenceComptable , 8, 14) AS
seqNum, SUBSTRING(referenceComptable, 4,7) AS yearCegi...
Maziar asked 6/9, 2018 at 10:11
4
I'm unable to execute HQL for Inner Joins, Query is executing correct at sql but not in HQL.
I don't know where i'm missing. Your help is appreciable.
***Error***: org.hibernate.hql.ast.QuerySynt...
9
How can I get row count from all tables using hive? I am interested in the database name, table name and row count
1 Next >
© 2022 - 2025 — McMap. All rights reserved.