-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to use the Composite design pattern with Hibernate
PostPosted: Fri Mar 26, 2004 5:51 pm 
Newbie

Joined: Mon Oct 27, 2003 6:41 pm
Posts: 7
Essentially I have an object which contains other objects(which could be other containers or a leaf object) and I am using the Composite design pattern and need help using and mapping this with Hibernate.

public abstract class Component{
int id;
String name;
someOperation();
...
}

public class Composite extends Component{
...
List items; //Contains all subComponents
someOperation();
...
}

public class Leaf extends Component{
someOperation();
...
}

How can query on just the parent containers id, and populate the whole structure?

Thanks for any help.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 27, 2004 4:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
from Component

Please read the doc in polymorphism

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 03, 2004 12:59 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
the wiki has a subject on this:

http://www.hibernate.org/86.html

_________________
Mauricio Hern


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