Top "Hql" questions

Use this tag for questions concerning "Hibernate Query Language" (HQL), a query language used by Hibernate and NHibernate.

One-To-Many relationship gets duplicate objects without using "distinct". Why?

I have 2 classes in a one-to-many relationship and a HQL query that is a bit strange. Even if I have …

java hibernate hql distinct one-to-many
Using hibernate/hql to truncate a table?

What is the recommended way to truncate a table using hibernate/hql? I've tried this: Query query = session.createQuery("truncate …

hibernate hql truncate
Hibernate could not locate named parameter even if it exist

Hibernate Keeps detecting org.hibernate.QueryParameterException: could not locate named parameter [name] even though it exist. here's my hql Query …

java hibernate hql named-parameters
Hibernate criteria: how to order by two columns concatenated?

I have a Person table which has two columns: first_name and last_name. The Person class has two corresponding …

java hibernate hql hibernate-criteria
Hibernate Named Query Order By parameter

Can anyone point me to how we can pass an order by clause as a named parameter to HQL? Example …

java hibernate orm hql sql-order-by
Not supported for DML operations with JPA update query

This has been asked once before but the solution did not solve the issue. I am creating a JUnit test: @…

java hibernate spring-mvc jpa hql
Hibernate HQL: Get count of results without actually returning them

I want to get the count of the results of a dynamically-generated HQL query, without actually getting the list of …

hibernate hql
How to do a Union SQL statement in HQL?

I'm trying to create a Union between two tables, using HQL (Hibernate Query Language). This SQL script works fine on …

hibernate grails hql grails-controller
How to left join fetch multiple children in Hibernate?

I'm working with hibernate and I'm having troubles creating an hql query that fetches all the children of my object. …

hibernate hql fetch
HQL: Using Boolean in Named Queries

Can you please help me? I have error in querying boolean value "r.isDefault = true". In my HQL named query: &…

hibernate hql boolean named