-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: [PLEASE HELP] : Hibernate and subqueries
PostPosted: Sun May 01, 2005 4:37 pm 
Regular
Regular

Joined: Sat May 15, 2004 4:27 am
Posts: 79
Hi,

i am trying to perform that query and i have exception :

Query q = session.getSession().createQuery("" +
"SELECT M2.machineId " +
"FROM ( " +
" SELECT * " +
" FROM fr.test.Machine Ma " +
") M2 "
);

Hibernate (2.1.6) throws me that exception :

net.sf.hibernate.QueryException: in expected: SELECT [SELECT M2.machineId FROM ( SELECT * FROM fr.test.Machine Ma ) M2 ]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:102)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:294)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1562)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1533)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at fr.gouv.finances.copernic.mas.stf.test.hibernate.TestSQL.main(TestSQL.java:22)


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 01, 2005 8:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
From-Clause subselects are not supported.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 12:44 am 
Regular
Regular

Joined: Sat May 15, 2004 4:27 am
Posts: 79
Ok.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.