-->
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.  [ 2 posts ] 
Author Message
 Post subject: Accessing inherited data members through Criteria sql
PostPosted: Mon Dec 05, 2005 5:43 pm 
Newbie

Joined: Mon Dec 05, 2005 5:34 pm
Posts: 3
Location: Cincinnati, OH
I need to query an object based on a numeric field that is inherited from a super class. The database field is numeric as well, but I am allowing wildcard searches (eg Expression.like()). My solution so far has been to cast the database field to varchar and then I can do the query for these type of properties.

My two approaches have been HQL and the Criteria query.

I feel like neither of these will work:

1) HQL won't work because it doesn't allow me the ability to cast a numeric database field to char to allow wildcards, although I have no problem accessing the property.

2) SQL expressions in Criteria allow me the ability to cast the field, but I don't have the table alias available on the super class.

Any ideas? Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 3:47 pm 
Newbie

Joined: Mon Dec 05, 2005 5:34 pm
Posts: 3
Location: Cincinnati, OH
Any ideas on this problem?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.