-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matthias
K�spert
Sent: Wednesday, March 09, 2005 11:53 AM
To: andromda-user
Subject: [Andromda-user] Hibernate cartridge: one-to-one relationship
Hi guys,
and another question (hopefully the last one today ;-):
I modeled a one-to-one composition relationship between Person (the
composer with a black diamond) and PersonData (the composite object) and
I get a PersonData.hbm.xml:
<one-to-one name="person"
class="com.mksoft.ODBICartridgeTest.PersonImpl" outer-join="auto"
property-ref="data"/>
Looks ok, but the Person.hbm.xml contains:
<many-to-one name="data"
class="com.mksoft.ODBICartridgeTest.PersonDataImpl" outer-join="auto"
unique="true" not-null="true" cascade="delete"> <column
name="DATA_FK"/>
</many-to-one>
Why this definition is many-to-one? Shouldn't it be one-to-one too?
[CB] No, if you'll notice the unique="true" attribute it basically means
it�s a one-to-one. The cartridge generates the appropriate mapping based on
given circumstances. Sometimes it makes sense to have the other end be a
one-to-one and sometimes not. If you're interested...look at the template
that generates this to see what I mean.
TIA,
Matthias
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user