Not certain, but I believe <any> is the equivalent to <many-to-one>, and
<many-to-any> is used like <many-to-many> inside a <set> (or other
collection) element.

On Tue, Oct 6, 2009 at 3:00 PM, Arvind <[email protected]> wrote:

>
> *trolling*
>
> No one has an answer to this?
>
>
> On Oct 5, 2:20 pm, Arvind <[email protected]> wrote:
> > I think I'm missing something simple here.
> >
> > in the following example of Father and Child (parent-child
> > relationship)
> >
> > Father:
> >
> >   <class name="father" table="father" lazy="false">
> >
> >     <!-- identity mapping -->
> >     <id name="ID" unsaved-value="any">
> >       <column name="ID" />
> >       <generator class="native" />
> >     </id>
> >
> >     <bag name="children" cascade="save-update" lazy="false">
> >       <key column="father_id" />
> >       <one-to-many class="child" />
> >     </bag>
> >
> >   </class>
> >
> > AND Child:
> >
> >   <class name="child" table="child" lazy="false">
> >
> >     <!-- identity mapping -->
> >     <id name="ID" unsaved-value="any">
> >       <column name="ID" />
> >       <generator class="native" />
> >     </id>
> >
> >     <many-to-one name="my_father"
> >                 class="father"
> >                 column="father_id"
> >                 cascade="none" lazy="false" not-null="true"/>
> >
> >   </class>
> >
> > This mapping says -
> > A father can have multiple children.
> > A child can have only one father.
> >
> > IF the previously defined mapping and constraints are CORRECT -
> > then my confusion is regarding many-to-any.
> >
> > That is because many-to-any needs to be within a set element
> >
> > <set>
> >   <many-to-any ..../>
> > </set>
> >
> > which is throwing me off the multiplicity of the association here!
> > I mean.. I expected it to be like many-to-one ... but with the "one"
> > part being heterogeneous.
> >
> > Please help!
> >
> > thanks.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to