-->
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.  [ 1 post ] 
Author Message
 Post subject: HQL query - Unable to sort by joined-subclass attribute
PostPosted: Fri Nov 17, 2006 3:00 pm 
Newbie

Joined: Fri Nov 17, 2006 11:58 am
Posts: 1
Hi,

I am looking for a way to sort a resultset by an attribute of a subclass in HQL

The SQL query looks like (in fact it is much more complex than that; I don't intend to use plain SQL):
Code:
select * from account ac
left join form fo on ac.id = form.accountId
left join specificForm sf on fo.id = sf.id
order by sf.rate



I am unable to produce a working HQL query.
Code:
from Account ac
left join fetch ac.forms fo
order by fo.??



The tables look like this:

ACCOUNT:
id

FORM:
id
accountId

SPECIFICFORM: (this table is mapped as a joined-subclass of Form)
id (same as form.id)
rate
type


Thanks in advance for your help.

Pierre

Hibernate version: 3.1.3 & 3.2.0.ga


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

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.