-->
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: Urgent...can anyone help me out please?
PostPosted: Tue May 10, 2005 5:22 am 
Newbie

Joined: Mon May 09, 2005 1:32 am
Posts: 7
Location: Bangalore
Hi ...
I am having a problem.here is the situation:
I have 2 DTOs SelectionListDTO with the fields selectionListId,selectionListName and a listData[] (one to many associtaion with another dto ListDTO).
The second DTO ListDTO contains listId,listName,orderID.My tables are selction_list and list_data.

selection_list tabel consists of selection_list_id,selction_list_name.

list_data tabel consists of list_id,selection_list_id,list_name.
My problem is that i dont want to use a bidirectional mapping.I just want ton use a uni directional mapping i.e one-to-many association from SelectionListDTO to ListDTO .Can i use this ?WI need to query the ListDTO to get the listnames depending on the selctionlistid of the list_data table.The probelm is that i dont have any field in my ListDTO which represents the selection_list_id of the list_data table.How can i get all the list names with selectionlistid=someid.
if had an selectionlistid field in my ListDTO i would have easily quieried the ListDTO like select ld fro ListDTO ld where ld.selectionlistid=(select sl.selectionListId from SelectionListDTo sl where sl.selectionListName="some name".But since my ListDTo doesnt have any field representing the selection_list_id of the list_data table nor it has any association back to the SelectionListDTO.Kindly help me out if this is possible?Aniticipating valuable replies as earlu as possible..


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 11:44 am 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
Your question is not very clear.


I understand that there are two questions: You want to know how to map a unidirectional one-to-many relationship between two entities, or you want to know how to query on an entity and to put a criteria on it's id?

You can either bind your two entities together through a mapping file, or you can issue a query to the database that will get you I think that you want

Please post your mapping and say what it is exactly that you want to achieve.

Have a good day,

_________________
Vincent Giguère
J2EE Developer


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.