hql « JPA « Spring Q&A





1. How to deal with the Hibernate hql multi-join query result in an Object-Oriented Way?    stackoverflow.com

How to deal with the Hibernate hql multi-join query result in an Object-Oriented Way? As I see it returns a list of Objects. yes, it is tricky and only you who write ...

2. Hibernate Exception    stackoverflow.com

org.hibernate.hql.ast.QuerySyntaxException: cannot dereference scalar collection element: cspName

st.append("SELECT customers.name,sum(csp.cspValue) as TotalMoney ");
            st.append("from Account as account ");
     ...

3. hibernate top N rows HQL query    stackoverflow.com

I am using the following code to execute an HQL query with Hibernate:

String myHqlQuery = "select from MyTable where Something = ? order by SomeVal";
// Set bind values ...
getHibernateTemplate().find(myHqlQuery, bindParams);
Now, I ...

4. Insert Row Into Composite Table With Hibernate Named Query    stackoverflow.com

Does anyone know the correct syntax in HQL to insert a row into a composite table? or an example somehwere else? Nothing online, man I miss Linq-To-Sql.

@NamedQueries({
@NamedQuery( name = "WebsiteAction.addActionWebsite", ...

5. Java Hibernate / Spring, doing partial match query ("contains")?    stackoverflow.com

I'm still fairly new to hibernate and can't seem to find how to do this, maybe I'm searching using the wrong terminology. I am passing in a user provided value from ...

6. HQL - Update field and return resulting value in one query    stackoverflow.com

I have a table that is going to consist of columns of integers, each essentially being a sequence. Each row represent a single customer account and the sequences tied to ...

7. Want to fetch only 5 records with HQL    stackoverflow.com

Possible Duplicate:
How do you do a limit query in HQL
I am new to HQL. I have following working HQL query:
from Order as o where ...

8. Using Hibernate query : colon gets treated as paramater / escaping colon    stackoverflow.com

return sessionFactory.getCurrentSession().
            createQuery("FROM Weather WHERE city_id = :id AND date " +
         ...

9. Hibernate custom HQL for this mapping    stackoverflow.com

I have following tables

------------
BAR
------------
ID
number

------------
ZOO
------------
ID

------------
FOO
------------
ID

------------
MAPPER
------------
ID
FOO
BAR
ZOO
Now I want to fetch all ZOO for particular FOO So I will do
select ZOO from MAPPER where zoo = someZoo
but now I want these ZOO sorted ...





10. Help in HQL Optimization    forum.springsource.org

11. Hibernate HQL editor working with Spring    forum.springsource.org

Hi, I need a tool where I can write hql and test it. Before I used HQL query editor, but after implementing Spring there is no hibernate.cfg.xml any more. How can ...

12. Problem with Hibernate HQL    forum.springsource.org

I am trying to use this query: Code: //Recupero la sessione da Hibernate Session session = sessionFactory.getCurrentSession(); logger.debug("Il nome della licenza e': "+nomelicenza); String textQuery = "from Vocelicenza as v where ...

13. HQL query and Execution    forum.springsource.org

Hi, I'm totally new to Spring/hibernate... I would be very grateful If you guys could lend me a hand Say you have a table "X" and it has a timeStamp(string) and ...

14. Unknown HQL return alias "currentTask    forum.springsource.org

Hi, i am trying to generate a report using hibernate the following query is in the JRXM file... select mo.currentTask, count(*) from MasterOrder mo where mo.createdDate between '01-DEC-2010' and '30-DEC-2011' and ...

15. org.hibernate.hql.ast.QuerySyntaxException    forum.springsource.org

org.hibernate.hql.ast.QuerySyntaxException I created a pojo as package com.web; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="STUDENT") public class Student { private String name; private String id; private String description; ...

16. Hibernate HQL - Trim    forum.springsource.org

Hi All, Sorry if Ive missed something here but I cannot seem to find a answer to my problem Can anyone tell me if there is a way in HQL that ...





17. HQL join many to many table    forum.springsource.org

Hey guys What i am trying to do is i have three tables "deal", "deal_location" and "location" "deal_location" is a table for a Many to Many relationships so e.g. many deals ...

18. PetClinic mod. - HQL help please    forum.springsource.org

Apr 22nd, 2005, 11:53 AM #1 jazzle View Profile View Forum Posts Private Message Visit Homepage Junior Member Join Date Mar 2005 Location Liverpool, UK Posts 21 PetClinic mod. - HQL ...

19. Hibernate HQL Query Problem    forum.springsource.org

Hello, I just started getting startet with Spring and Hibernate reading the "spring in action" book, the spring reference and writing a small test-programm. now i have a (guess a simple) ...

20. SWF + Hibernate problem: hql statement is not correct    forum.springsource.org

Sep 11th, 2005, 03:58 AM #1 ajatienza View Profile View Forum Posts Private Message Junior Member Join Date Sep 2005 Posts 3 SWF + Hibernate problem: hql statement is not correct ...

21. mixed HQL query (mapped/unmapped tables)    forum.springsource.org

hi I know, that this is not the most appropriate forum, but I'm sure, that for our gurus this q is a piece'o'cake I have a table "A" mapped to class ...

22. hibernate HQL problem    forum.springsource.org

Hi, I'm trying to do this : getHibernateTemplate().find("from beans.User where name like ? and password like ?",new Object[]{name,password}); but I got this error : java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based! ...

23. How to convert SQL into HQL    forum.springsource.org

How to convert SQL into HQL I have to fire one sql statement(containing left join and sub queries) through hibernate. I think ,we have 2 options 1. Converting into HQL 2. ...

24. HQL problem: db2 date function    forum.springsource.org

hi, i have a HQL problem using spring 2.0-rc3 and hibernate3, and db2 v8.1. my code in dao class is here. Code: public List getAccountList(Date d) { return getHibernateTemplate().find("from test.Account account ...

25. HQL Problem    forum.springsource.org

HQL Problem List. I am using Spring 1.2.8/Jboss 3.2.8. I just upgraded to Hibernate 3 from 2 and I started getting this exception. java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based! at ...

26. How do you add two columns in HQL    forum.springsource.org

Nov 21st, 2006, 06:08 PM #1 jiteshks View Profile View Forum Posts Private Message Member Join Date Nov 2006 Posts 55 How do you add two columns in HQL How do ...

27. How to Use decode' function in HQL    forum.springsource.org

Dec 4th, 2006, 02:29 PM #1 jiteshks View Profile View Forum Posts Private Message Member Join Date Nov 2006 Posts 55 How to Use decode' function in HQL How do I ...

28. help about experiences - a good hql editor    forum.springsource.org

I've never used one personally. If queries get that hard, it's time to use QBC. I'd be interested to know if you find a decent one however.

29. any null check(NVL) function in HQL?    forum.springsource.org

any null check(NVL) function in HQL? Hi, I am using Hibernate3.0. I want to know how to use null check function(NVL). My DB is Oracle 10g.My dialect is "org.hibernate.OracleDialect". I am ...

30. ClassNotFoundException: org.hibernate.hql.ast.HqlToken    forum.springsource.org

ClassNotFoundException: org.hibernate.hql.ast.HqlToken Hi all, I'm tryng to use the class HibernateTemplate to read data from database. My web application run on a wls8.1 and i'm using Spring 2.03 framework. the follow ...

31. Many-to-many retrieval with HQL?    forum.springsource.org

Many-to-many retrieval with HQL? Hello I am using Spring and XDoclet to build a project: The feat I am trying to attempt here is to pass in the id of an ...

32. Hibernate HQL - retrieve with most recent date field?    forum.springsource.org

DetachedCriteria maxQuery = DetachedCriteria.forClass( Invoice.class ); maxQuery.setProjection( Projections.max( "InvoiceDate" ) ); Criteria query = getSession().createCriteria( Invoice.class ); query.add( Property.forName( "InvoiceDate" ).eq( maxQuery ) );

33. HQL "contains" query?    forum.springsource.org

HQL "contains" query? Hi, I'm suppose this is a simple question, but I couldn't find anything on the Net (maybe I was looking with the wrong search terms)... What I want ...

34. Hibernate HQL: how to retrieve latest sub entry in a joined main-sub join?    forum.springsource.org

I have a one-to-many object association (Customer --> Invoice) where I want to create a HQL query that retrieves all the customer objects with the most recent customer invoice. For example... ...

35. HQL Question    forum.springsource.org

I want to query for a collection of objects where the result is a collection of all the objects that are not in my current collection. How can I do so ...

36. rare problem regarding with org.hibernate.hql.ast.QuerySyntaxException    forum.springsource.org

Nov 4th, 2007, 08:22 PM #1 alfrancis View Profile View Forum Posts Private Message Junior Member Join Date Nov 2007 Posts 1 rare problem regarding with org.hibernate.hql.ast.QuerySyntaxException org.hibernate.hql.ast.QuerySyntaxException: unexpected token: order ...

37. lazy fetching ignored in hql?    forum.springsource.org

lazy fetching ignored in hql? hi.. i have the following query "from " + UnderBrief.class.getName() + " brief " +"left join brief.policies pols where pols.policyId=" + policy + " order by ...

38. List as HQL query parameter    forum.springsource.org

Criteria crit = getSession().createCriteria(FeedLink.class); crit = crit.add(Restrictions.not(Restrictions.in("propertyName", exclusionLinks ))); return crit.list();

39. Batch Update in HQL    forum.springsource.org

Hi We are using Spring 2.0 and Hibernate 3 We are trying to do a "batch update", for a bunch of transactions to see what is the performance gain. The update ...

40. hql    forum.springsource.org

hql Hi, I need a help regarding how to use "order by" for non-aggregated properties. e.g. "from DomesticCat cat order by cat.name asc,cat.weight desc, cat.birthdate". If DomesticCat has some other property ...

41. hql    forum.springsource.org

hql Hi all, I need to know how many times a paticular name has appeared in a table. e.g. if "john" has appeared 3 times I should get "3", if "smith" ...

42. HQL map value search    forum.springsource.org

Hello, I have a simple question about hql using java.util.map. I saw a previous entry that explained how to search for a particular map key but what I'd like to do ...

43. HQL: problem of logic for a query    forum.springsource.org

Hello guys pls follow the next situations first CabeceraComprobanteVenta has a Set to DetalleComprobanteVenta and DetalleComprobanteVenta has a simple CabeceraComprobanteVenta how a father one-to-many Code: String sql = " SELECT DISTINCT ...

44. Re HQL Result List+Lazyinitialization Exception    forum.springsource.org

Re HQL Result List+Lazyinitialization Exception Hi this is suresh, I am facing on eproblem with HQL... my HQL Query is:"select r from Review as r, ReviewComment as rc where r.objectId = ...

45. Coneverting hql to sql    forum.springsource.org

Coneverting hql to sql Hi all, i've a problem regarding knowing the recordcount of a select: i would know the count of records performing a "SELECT COUNT(*) FROM (hqlquery) ), but ...

46. Spring, Hibernate, Junit trying to commit before HQL query    forum.springsource.org

Spring, Hibernate, Junit trying to commit before HQL query Hi We're using: Spring 2.5 Hibernate 3.2 Junit 3.8 and are trying to retrofit Spring and Hibernate into an existing application. One ...

47. Hibernate HQL    forum.springsource.org

If I write SQL with the following: select a.role_id, b.role_desc_txt from user_role a, role_def b where a.user_id = 1 and a.role_id = b.role_id; How would I write that in HQL ? ...

48. Hooking all HQL queries    forum.springsource.org

Hooking all HQL queries Hi all, I'm trying to intercept all HQL queries in our web application in order to measure their time and do some profiling afterwards. The most important ...

49. hibernate HQL select..from clause    forum.springsource.org

Hi, I am working on hibernate query, I am not able to execute the below query, it throws query syntax exception at column 26. I am not sure how to correct ...

50. DateAdd in hql    forum.springsource.org

Hi, I want to add days in a date by means of hql but I don't know how do it. I tried to use "DateAdd(Days, 10, s.date) but it doesn't found. ...

51. sql to Hql    forum.springsource.org

52. Oracle Hints in HQL    forum.springsource.org

As per this Hibernate enhancement request the use of Oracle SQL hints is not directly supported: http://opensource.atlassian.com/proj...rowse/HHH-2736 I am using a work arround by sub-classing org.hibernate.EmptyInterceptor and over-riding the function "String ...

53. Distance calculation between two locations (HQL)    forum.springsource.org

Distance calculation between two locations (HQL) I've got what I believe to be a fairly common requirement to query for results based upon their distance from a defined point. Assume you've ...

54. getting coutn from hql    forum.springsource.org

55. When using hibrnate, HQL is not converting to SQL Queries    forum.springsource.org

When using hibrnate, HQL is not converting to SQL Queries Hi All, I am using Hibernate, using this i am foming the query by using the below code. SessionFactory sfobject = ...

56. HQL query problem    forum.springsource.org

HQL query problem Could you help me create a HQL query? I have the objects Employee and Department with one-to-many relationship so that the Department object has a set of Employees. ...

57. HQL Exception: pls help    forum.springsource.org

Aug 29th, 2010, 10:08 AM #1 manojmadushantha@gmail.co View Profile View Forum Posts Private Message Junior Member Join Date Aug 2010 Posts 7 HQL Exception: pls help Im working on a spring ...

58. convert on SQL Query to HQL    forum.springsource.org

Hi my question is simple but may a little bit rude. Could please one of you convert one SQL Query to hql for me :> Select statistic.* FROM statistic INNER JOIN ...

59. Controller Scaffolding around HQL    forum.springsource.org

Controller Scaffolding around HQL Hi All, I like Roo, but the reality is that the basic scaffolding around Entity is no close to reality. I would like Roo to provide (and ...

60. Spring / HQL query - HELP    forum.hibernate.org