Please remove constraint=true from parent table. ----- Original Message ----- From: "Neema, Devesh (MED, Contractor)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 02, 2003 9:39 AM Subject: [Hibernate] Composite Id one-to-one relationship
Hi Hibernate Users, I have a tables with following Structure : Table A :- Composite ID 1. PatId :- many-to-one relationship with Table C 2.ParticipantId :- many-to-one relationship with Table D Table B :- Composite ID 1.PatId 2.ParticipantId Table A and Table B are one-to-one I have represented this in HBM file <class name="TCx1PtsiteT" table="A"> <composite-id unsaved-value="any" > <key-many-to-one name="Participant" class="TCx1ParticipantM" column="Participant_ID"/> <key-many-to-one name="Patient" class="TCx1PatientT" column="PatID"/> </composite-id> <one-to-one name="accPatient" class="TA3PatientT" constrained="true" outer-join="false"/> </class> <class name="TA3PatientT" table="B"> <composite-id unsaved-value="any"> <key-property name="participant" type="string" column="Participant_ID"/> <key-property name="patient" type="integer" column="PatID"/> </composite-id> <one-to-one name="ptSite" class="TCx1PtsiteT" constrained="true" outer-join="false"/> </class> Is this correct way to represent the relationship ? Devesh ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel