-->
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.  [ 7 posts ] 
Author Message
 Post subject: ORDER BY polimorphic query in case of implicit polimorphism
PostPosted: Thu May 31, 2007 7:19 am 
Beginner
Beginner

Joined: Tue Aug 23, 2005 8:15 am
Posts: 45
Such HQL query
"SELECT x.Time, count(x.Time) FROM EventFact x GROUP BY x.Time ORDER BY x.Time"
returns set of object wich are subclasses of EventFact.

But they are not sorted by x.Time!!!

What is the reason?

Implicit polymorphism (table-per-concrete class) is used.

In log-file I see SQL Select queries for each of concrete class.


Top
 Profile  
 
 Post subject: Re: ORDER BY polimorphic query in case of implicit polimorph
PostPosted: Fri Jun 01, 2007 4:34 am 
Beginner
Beginner

Joined: Tue Aug 23, 2005 8:15 am
Posts: 45
Dear all!

Please help to solve the issue!!!


sergunok wrote:
Such HQL query
"SELECT x.Time, count(x.Time) FROM EventFact x GROUP BY x.Time ORDER BY x.Time"
returns set of object wich are subclasses of EventFact.

But they are not sorted by x.Time!!!

What is the reason?

Implicit polymorphism (table-per-concrete class) is used.

In log-file I see SQL Select queries for each of concrete class.


Top
 Profile  
 
 Post subject: order by & setmaxresults do not work w/ implicit polymop
PostPosted: Mon Jun 04, 2007 4:42 pm 
Beginner
Beginner

Joined: Wed Nov 29, 2006 10:32 am
Posts: 34
Hi - I stumbled over the same issue: It simply seems that neither order by nor SetMaxResults works with implicit polymorphism - they are only attached to each SQL query alone.
Sergey?
(I can provide small full examples if necessary)

Regards
Harald


Top
 Profile  
 
 Post subject: order by & setmaxresults do not work w/ implicit polymop
PostPosted: Mon Jun 04, 2007 4:43 pm 
Beginner
Beginner

Joined: Wed Nov 29, 2006 10:32 am
Posts: 34
-- sorry, double posting --


Top
 Profile  
 
 Post subject: Re: order by & setmaxresults do not work w/ implicit pol
PostPosted: Thu Jun 07, 2007 7:01 am 
Beginner
Beginner

Joined: Tue Aug 23, 2005 8:15 am
Posts: 45
It seems to me that is impossible in single SQL qeury since in case of implicit polimorphism type column doesn't exist.
One way is to sort objects via. programming languagae features, maybe that doesn't correspond ideas of Hibernate.
That is question to Sergey.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 10:37 am 
Beginner
Beginner

Joined: Wed Jun 28, 2006 2:03 pm
Posts: 22
nothing?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 4:58 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
If I understand this correctly, then NHibernate doesn't support this because doing a polymorphic query involves issuing several queries and NHibernate would have to do any aggregation (orders/groups/sums/etc.) in memory. Currently NHibernate doesn't do that.


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