-->
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.  [ 5 posts ] 
Author Message
 Post subject: Using HQL to search in a database.
PostPosted: Thu Apr 06, 2006 11:23 am 
Newbie

Joined: Tue Mar 21, 2006 4:25 am
Posts: 13
Hello,

I am trying to make a search inside the database either by using HQL or else Criteria. I already used Criteria, however I do not know how to use it for this kind of search.

What I am trying to do is search some text inside all the fields of all the tables inside my database! Is this even possible?

I will be very greatfull for any sugestions.

thanks and regards,
sim085


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 06, 2006 1:30 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Perhaps you need to add Compass framework to your mix
http://www.compassframework.org/display/SITE/Home

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 06, 2006 6:44 pm 
Newbie

Joined: Tue Mar 21, 2006 4:25 am
Posts: 13
Thanks :)

that sounds very intresting :)
I will have a look at it and try to see how to implement it, since it seems to be what I am searching for since at the end what I want to do is search a peace of text in my data modle (all fields inside all tables inside my database).

thanks again.
kcorp.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 3:55 am 
Newbie

Joined: Tue Mar 21, 2006 4:25 am
Posts: 13
However the examples I downloaded show I need to create other config files.

Is there any tutorial to say how I can re-use the hibernate .hbm files?

Please remeber that altough I have many tables, I only want to retrieve one object from the database.

example:

I have Student and Classes. If I search for class room "10B" then the return should be A List of Students that have a lesson in classrom "10B" and not an actuall list of Class objects.

regards,
kcorp


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 11:20 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I am not Compass expert but I am sure that it is possible. Perhaps you need to do something creative with search results representation.

Or you can use Lucene directly and build your simplified version of ORM search. It is not that hard actually, grab Lucene in Action book, it will help you get familiar with Lucene quickly

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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