-->
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: Returning search reults from multiple tables
PostPosted: Mon Mar 08, 2010 5:18 am 
Newbie

Joined: Mon Mar 08, 2010 4:56 am
Posts: 1
Hi Guys

This is my first post so hopefully someone can help me here. I need to retrieve data which is spread over two database tables (which are linked throught another table) so that I can display it in a JSP page but Im having difficulty with it...

The tables are as follows:

BIOGRAPHIC_DATA:
id (PK)
title
forename
surname
user_id (FORIEGN_KEY to USER.id)
dob... ect...

USER:
id (PK)
user_status
role... etc...

OPERATOR:
id (PK)
username
password
user_id (FORIEGN KEY to USER.Id)
status


The fields I need to retreive are:
Code:
OPERATOR.id
BIOGRAPHIC_DATA.title
BIOGRAPHIC_DATA.forename
BIOGRAPHIC_DATA.surname
OPERATOR.username
OPERATOR.status



Given this schema, is it possible to use DetachedCriteria and make one single call to
Code:
findByCriteria(detachedCriteria, offset, maxRecs)
and return me the set of records that I need.

Our codebase currently has a 'Retriever' per data object, so we have a BiographicDataRetriever, UserIdentityRetreiver, OperatorRetriever etc... Which one of these would be best to implement the code in...

Thanks for any help you can provide.

Regards
Martin


Top
 Profile  
 
 Post subject: Re: Returning search reults from multiple tables
PostPosted: Mon Mar 08, 2010 1:14 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Wrong forum - try the main Hibernate User forum.


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