-->
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: one-to-many relation
PostPosted: Thu Dec 09, 2004 5:06 am 
Newbie

Joined: Mon Dec 06, 2004 11:50 am
Posts: 2
Hi got a question.

I want to make a one-to-many relationship between two tables/classes


Class1 got:
id =(native generated id)
listnumber = (Long)


Class2 got
id =(native generated id)
listnumber = (Long)

In class two I want a function:

public Set getClass1()

that will return all entries (or instances) of Class1,

To be more specific:
an instance Class2 has for example listnumber = 2
and I want to get all the Class1's that has listnumber = 2

I've tried to use collection.one-to-many, without any success..

Is it possible to make this work in Hibernate?


//Martin


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.