-->
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: Mapping Question
PostPosted: Fri Sep 09, 2005 12:45 pm 
Newbie

Joined: Tue Mar 01, 2005 4:13 pm
Posts: 7
Hibernate version: 3.05

I have a mapping question that I have not been able to find an example for.

I have a class A, which is composed of composite instances of class B, and C.

Likewiae, class B, and C, are composed of composite class instances of class D, and E.


My question is. How do I map this relationship so that ALL primary keys are the same, and all respective fields for all classes are persisted into individual tables, and when loading,deleting,updating class A,
that instances of classes B,C,D and E respectively.


I have the answer to the last part, use the cascade="all" attribute.
It's the primary key aspect of this problem that has me confused.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Mapping Question
PostPosted: Mon Sep 19, 2005 4:18 pm 
Beginner
Beginner

Joined: Fri Aug 13, 2004 3:07 pm
Posts: 44
kjc5667 wrote:
Hibernate version: 3.05

I have a mapping question that I have not been able to find an example for.

I have a class A, which is composed of composite instances of class B, and C.

Likewiae, class B, and C, are composed of composite class instances of class D, and E.


My question is. How do I map this relationship so that ALL primary keys are the same, and all respective fields for all classes are persisted into individual tables, and when loading,deleting,updating class A,
that instances of classes B,C,D and E respectively.


I have the answer to the last part, use the cascade="all" attribute.
It's the primary key aspect of this problem that has me confused.

Thanks in advance.


I think that you can use the
Code:
<generator class="foreign">
    // I do not know what params go here
</generator>

and specify the Pk for A in B and C and so on.

_________________
Thanks
Sameet


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.