-->
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: HQL Question
PostPosted: Sun Jun 20, 2004 10:32 am 
Newbie

Joined: Sun Jun 20, 2004 10:24 am
Posts: 6
Hi folks !

I'm new to hibernate but already read some tutorials, reference manuals and wrote some test applications. First thanks to all of you who contributed to hibernate, it's a geat software !

My Question:

Is there any possibility in a HQL query, to use the return value of a method
call in the where clause... something like this:

"from Object o where o.equals(?)", otherObject

Since I already noticed that it might not be the best idea to overwrite the equals-method I still think this could be nice :)

thx, for you answers
Oliver


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 20, 2004 2:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
HQL is translated to SQL which is executed by the database. Calling methods is not supported.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 25, 2004 6:21 pm 
Newbie

Joined: Sun Jun 20, 2004 10:24 am
Posts: 6
Hi all !

Thx for your answer Gavin !

I understand that calling methods is not possible, but I found something
that does exactly what I wanted to achive with my "pseudo"-query

Object o=new Object();
o.setSomething("maybe a String");
Criteria c=session.createCriteria(Object.class);
criteria.add(Example.create(o));
List l=criteria.list();

nice :))

btw. I've read that in the book from Gavin and Christian which Christian
recommended to me today. The book is excellent !!! You did a good job
in making thinks clear :)


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.