value « HQL « JPA Q&A





1. Getting the object with the highest member value in hql?    stackoverflow.com

I'm still a little new to hql, and I had a question about aggregation functions and efficiency for a query I'm writing. Let's say I have this class mapped in hibernate (getters/setters/constructors/etc. ...

2. Constructing value objects using HQL or Creteria    coderanch.com

Suppose there are three non related entity classes A, B and C mapped into DB using Hibernate. There is a requirement to build a value object called V and it needs few properties (columns) from A, few from B and few from C. Now how I can construct the object of V using HQL or Criteria instead of using native SQL ...

3. how can HQL return a function value    forum.hibernate.org

Hibernate version:2.1.5 Name and version of the database you are using:SQL Server 2000 Hello, I am trying to convert the following SQL Server query to HQL: select datepart(hour, record_date), event_id, count(*) from raw_tb group by datepart(hour, record_date) , event_id I test the following HQL works with no problem: Select rawTb.eventId from RawTb rawTb group by {fn HOUR(rawTb.recordDate)}, rawTb.eventId but fails for ...

4. How to multiply and sum two values using HQL. - HELP ASAP!    forum.hibernate.org

I am trying to run a Hibernate Query to multiply and sum two values grouped by another values, I constantly keep getting SQLState = Null Invalid column Name errors... select poee.descrip, sum(qi.volume), sum(qi.volume * qi.avgCost) from trans as q joins... here... where d.termType = :termType.. and "some date range "... group by and order by are there... etc... This is how ...

5. Hexa value in HQL    forum.hibernate.org

Hi How could I write, in a HQL query, an equality on a hexa value ? I would translate something like this SQL select * from TFBUISI where CGEO = x'FFFF' (CGEO is a varchar2(2),not a number, and contains the highest values than you can put in this field ) to something like that String queryW = "select p from BusinessBO ...

6. HQL: How to subtract clumn values from two consecutive rows    forum.hibernate.org

Hi I am new to Hibernate and HQL. Please help me, possibly with an example. In my application, I am using MySQL and I need to query the DB to find the time difference between two rows in a table. The situation is something like this... In row 1: there is a date (D1) column and I need to find the ...

8. HQL and nested values    forum.hibernate.org

StringBuilder query = new StringBuilder(); query.append("SELECT A"); query.append(" FROM Addresses as I"); query.append(" inner join I.anag as A"); query.append(" where A.name = :foo.name");