hql « Field « JPA Q&A





1. Hibernate get single row from the table with maximum field value    stackoverflow.com

In Hibernate, how can I get single row from the table with maximum field value? Thanks

2. HQL query minus some specific fields    stackoverflow.com

It is possible with a HQL query to retrieve every fields EXCEPT one. Something like :

session.get(entityClass, id).withoutThisField(fieldNotDesired)
Example : I have a class Picture(int id, String name , byte[] file). I want to retrieve ...

3. How to count 2 fields with different conditions for each count in HQL    stackoverflow.com

I have a problem writing HQL. The problem is that I want something like this to be transferred to HQL

 select 
   tb.aca_year, 
   (case when tw.isfulltime = ...

4. How do I compare fields in two different tables using Hibernate?    stackoverflow.com

I need to compare fields from 2 different tables using Hibernate queries. Table A has a field which consists of sectionId(eg 1900). Table B has a field which consists of userId/sectionId(eg e1230-12w11-3ewq-qg22-34qa/1900). I ...

5. QueryException while requesting field of AuditInfo in HQL    forum.hibernate.org

@Type(type = "com.xxx.audit.AuditInfoType") @Columns(columns = { @Column(name = "lastUpdated", nullable = false), @Column(name ...

6. accessing static fields of a class in HQL    forum.hibernate.org

7. can HQL handle fields starting with an underscore?    forum.hibernate.org

Hi! In my application I have two business Objects, namely Product and Resource. A Product can have zero or more Resources, and Hibernate has field access to them, i.e.: Code: Product { private Set _resources; } Resource { } I would like to retrieve every Resource belonging to a Product in HQL. Why do the following ...

8. Is it possible to use HQL for fields not stored in the Datab    forum.hibernate.org

Is it possible to use HQL for fields not stored in the Database? For instance, let's say my object has a method - a getter - which instead of returning a property, runs some calculations. Is there anyway I can use HQL on this method? Now, I realize that there would be tremendous performance costs for this. How is this normally ...

9. HQL: from class where field in ( :set ), what is possible?    forum.hibernate.org

I've seen the example in 10.4.1.4 Code: List names = new ArrayList(); names.add("Izi"); names.add("Fritz"); Query q = sess.createQuery("from DomesticCat cat where cat.name in (:namesList)"); q.setParameterList("namesList", names); List cats = q.list(); Which indicates that a named argument to a set can be an ArrayList of strings. But does not inform as to what is fully possible. [and maybe things have changed since ...