-->
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: Problem on Polymorphic queries
PostPosted: Fri May 30, 2008 7:10 am 
Newbie

Joined: Tue May 27, 2008 11:21 am
Posts: 5
Hello all,

Is it possible to run a polymorphic query using ordering and where predicates on fields which belong to a subclass of the base class?

More specifically, my application includes a grid/table with search and order functionality. The rows of the grid represent hibernate beans which have the same super class. A column in the table could display values which belong to a field of only one subclass. The rest rows which represent beans of the same class hierarchy should display a default value.

My problem is that I cannot find a way to create hql or criteria queries which do polymorphic queries and also order and have predicates of fields belonging to one or some subclasses of the class hierarchy.

I have a feeling that hibernate does not support this feature. So my alternative solution is to avoid polymorphic queries and create a hibernate bean which represent a grid. Each field will map to a grid column.

However this approach requires a database view which maps to the new grid hibernate bean. And consequently static SQL (which I try to avoid) must be used for this purpose.

Do you have any idea on how to tackle the problem using hibernate?

Regards,

Kostas


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.