can you give an example of how this is done?

currently, we use a <sql many-key ...> to relate from
parent to child as in (A has a 1 to n relationship to
B):

<class name="A" ....>
   ...
   <field name="B" type="..." collection="vector" ...>
      <sql many-key="a_id"/>
   </field>
</class>

but we do not reference A in B anywhere.  should we
use the <sql name=".."> in the mapping for B to do
this?

thanks,
chris

--- [EMAIL PROTECTED] wrote:
> Chris Williams wrote:
> > 
> > as far as both our database and mapping.xml is
> concerned, no.  how would one
> > make sure the relationship is bi-directional?  i
> assume you are talking
> > about at the castor level.
> > 
> > on 1/8/02 12:52 AM, Thomas Yip at [EMAIL PROTECTED]
> wrote:
> > 
> > >
> > >
> > > Is the relationship a bi-directional
> relationship.
> > > Otherwise, make sure it is.
> 
> Chris, 
> 
> There are two types of relationships in most object
> persistence tools,
> uni-directional and bi-directional. A
> uni-directional relation is one
> which objectA makes reference to objectB, but
> objectB does not make
> reference to objectA. A bi-directional relation is
> just the opposite -
> objectA refers to objectB and objectB refers to
> objectA. 
> 
> In most situations, Castor requires that relations
> be mapped as
> bi-directional. To do so, make sure that both sets
> of objects have
> references to each other. For example, if objectA
> has a one-to-many
> relation to objectB, objectB must have a many-to-one
> relation back to
> objectA. 
> 
> Bruce
> 
>
-----------------------------------------------------------
> 
> If you wish to unsubscribe from this mailing, send
> mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to