-->
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.  [ 8 posts ] 
Author Message
 Post subject: Any changes to hql in rc1?
PostPosted: Tue Mar 01, 2005 4:36 am 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
I have a very, very simple named query:

from Unit u order by u.sortOrder asc where unitType_id=2

that worked flawless in hibernateb2 - I recently upgraded to rc1, now the query ignorse the where and retrieves all units no matter what unitType- have there been changes betweenn b2 and rc1 that could explain this behavior?

cheers
stf


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 4:56 am 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
and whats even worse: Unit is the parent in a inheritance-hierarchy that's been modeled using @Inheritance(strategy=InheritanceType.JOINED)

in the b2

from Unit u order by u.sortOrder asc where unitType_id=2

always returned the correct child-instances - rc1 always returns a Unit, ignoring the inheritance.

Are there any new switches/flags that were introduced with rc1??

cheers
stf


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 5:12 am 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
ooops, sorry, looks like I barked at the wrong tree: the database was corrupted and all inherited tables were empty... this, at least solves the casting-problems.

*But* the query still ignores the "where unitType_id=2" (the where-clause is also missing from the generated sql)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 5:21 am 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
and the fun does not stop here:

from Quiz q order by q.sortOrder asc where parentunit_id=:chapterId and unittype_id=3

now complains that:

Caused by: org.hibernate.QueryException: Named parameter does not appear in Query: chapterId [
from de.vierundsechzig.springer.model.modules.quiz.Quiz q order by q.sortOrder asc where parentunit_id=:chapterId and unittype_id=3
]


are the where-clauses cut off by some strange beahvior of the new parser? Are explicit wheres (unittype_id=3) not allowed any more?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 11:13 am 
Beginner
Beginner

Joined: Wed Jan 21, 2004 10:15 am
Posts: 24
Location: Munich, Germany
Hi!

Have you tried to reverse the "order by" and "where" part? At least in SQL, the "order by" has to be after the "where".

Christian


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 12:47 pm 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
ouch. yes. Of course. Now that you say it...

It's no wonder, that it doesn't work in rc1, it was just a wonder that it worked in b2:)

reversing the order works, the where gets parsed again, and i guess the grammar has been corrected to stop the parsing after the order-statements...

thx&excuse my blindness
stf


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 1:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Please provide your case as an enhancement in JIRA. We should raise an appropriate exception here.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 1:42 pm 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
ok, I did. Many thx for the help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.