Yes, different primary keys, however you can have the child entity have the same foreign key as the parent in the one to one by setting the tagged value @andromda.persistence.foreign.identifier to true: http://team.andromda.org/docs/andromda-hibernate-cartridge/modeling.html
-----Original Message----- From: Matthias K�spert [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 09, 2005 2:08 PM To: Chad Brandon Cc: andromda-user Subject: RE: [Andromda-user] Hibernate cartridge: one-to-one relationship Hey Chad, so just to be shure: the two entities do have different PrimaryKey's/ID's? That's important, because I'd like to be able to switch the access-layer and keep my database-contents and ODBI does not support this 'referencing by same primary-key' feature like Hibernate. Thanks for your help! Matthias On Wed, 2005-03-09 at 20:27, Chad Brandon wrote: > Hey Matthias, > > You asked for a hibernate link and here it is: > http://www.hibernate.org/hib_docs/reference/en/html/mapping.html#mapping-dec > laration-onetoone :) > > Basically it comes down to be able to define where the foreign key goes. > > Chad > > -----Original Message----- > From: Matthias K�spert [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 09, 2005 12:24 PM > To: Chad Brandon > Subject: RE: [Andromda-user] Hibernate cartridge: one-to-one relationship > > Hi Chad, > > yes I see: if it's a composition or aggregation assoc it's done like > this - but why? > > Note: this is not a real problem, just interest - I'm not feeling bad if > you don't have time to answer this :-) I'd be glad if you just have a > link to the corresponding Hibernate-doc. > > TIA, > Matthias > > On Wed, 2005-03-09 at 19:58, Chad Brandon wrote: > > > > > > -----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 > > > > > > > ------------------------------------------------------- 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
