-->
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: Mapping advice wanted.
PostPosted: Mon Oct 06, 2003 3:02 pm 
Beginner
Beginner

Joined: Fri Sep 12, 2003 12:54 pm
Posts: 20
I'm looking for advice on how to map the following association:

"A" has a reference to "B" ... "B" is really an interface, of which there are a few implementations - "B1", "B2", "B3". The three implementations all have their own (unique) additional properties for persistence (that aren't defined on "B").

The "B" is associated to exactly one "A" - and in fact can't exist without the "A" holding a reference to it.

Ideally I'd like to map this like:
Code:
<class "A">

  <property ...>

  <property ...>

  <component  class "B">

     <property ...>

     <property ...>

     <joined-subclass "B1"  .... >
       <property ...>
       <property ...>
     </joined-subclass>

     <joined-subclass "B2"  .... >
       <property ...>
       <property ...>
     </joined-subclass>

     <joined-subclass "B3"  .... >
       <property ...>
       <property ...>
     </joined-subclass>
   
  </component>

</class>


But joined subclasses aren't allowed in <component>s.

Does anyone know of an alternative other than one-to-one? I'd really like to not have to assign Ids to "B"s (or at least just use the Id of the "A" as the Id of the "B"), and their lifecycle should be that of the "A".

thanks,
james


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.