-->
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.  [ 3 posts ] 
Author Message
 Post subject: Query based on arbitrary method/fake getter?
PostPosted: Sat Oct 08, 2005 11:59 am 
Beginner
Beginner

Joined: Thu Jun 23, 2005 11:23 am
Posts: 36
Location: Lancashire, England
Hallo -- would it be possible to query for instances of a class based on a method?
Perhaps if you had a method called getFakeMethod() that returned a String, you could write a query along the lines of
Code:
from MyClass c where c.fakeMethod="PASS"


Obviously, the getFakeMethod() method would perform some test that returned "PASS" or not.
Is there any way to do this -- or, even simpler, maybe just to query on a straightforwards method?
Or does the fact that this would probably require every persistent instance of the class to be returned for testing make this a dumb question?
Cheers,
doug.

_________________
Common sense is what tells you the world is flat.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 2:23 pm 
Newbie

Joined: Wed Mar 30, 2005 8:58 am
Posts: 10
Location: São Paulo / Brazil
the HQL language is just a way to execute arbitrary SQL code, based on your object tree.

actually, HQLs do NOT query through objetcts, besides it's translated to SQL code and than executed in the database. So thats why what you need will not occur. Maybe there's another way to do something simillar.

_________________
www.brunoborges.com.br


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 11:52 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
another and only way are database functions (stored procedure)


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