-->
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.  [ 1 post ] 
Author Message
 Post subject: Newbie: Need values of another table in a table's mapping
PostPosted: Tue Sep 25, 2012 10:05 am 
Newbie

Joined: Tue Sep 25, 2012 10:01 am
Posts: 4
Hi all!

I am very new to Hibernate and can't find an answer to the following question. Hopyfully someone here can get me on the right track.

There are three tables involved in my problem: A, B and C.

Table C has three columns: A_id, B_id and some bigint(20) value.

An example for table C might look like this:

A_id; B_id; some_value
1 3 NULL
1 8 13
2 3 NULL

I want to use a hbm.xml mapping that returns a Set<ArrayList<Object>> into my Java class corresponding to table A, where each ArrayList has two elements: an object of B, and an Integer-object holding the value stored in some_value.

Or in other words: In my Java class corresponding to table A there must be a method that returns such a set.

The returned set for A_id = 1 would contain two ArrayLists:
object of 3, NULL
object of 8, 13

How can this be done?

Kind regards!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.