-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Foreign Key generation not happening for Sets in Hibernate3
PostPosted: Wed Jan 26, 2005 12:49 pm 
Newbie

Joined: Thu Aug 19, 2004 10:52 am
Posts: 14
I trying to generate a schema from my hibernate mapping, and in general it is work well, but there is at least one notable exception. There is a set of objects that are mapped through a 3 table. The tables are created correctly, but no foreign keys are generated for this.

Am I missing something or should I logged this as a bug?


Hibernate version:
Hibernate3

Mapping documents:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>

<!--

Created by Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/

-->

<class name="ospoint.hibernate.PatientStudyStep"
dynamic-update="true"
table="PATIENT_STUDY_STEP">

<!-- simple properties -->
<composite-id name="id"
class="ospoint.hibernate.PatientRecordPK">
<key-property name="patientId" type="java.math.BigDecimal"
column="PATIENT_ID" length="22" />
<key-property name="studyId" type="java.math.BigDecimal"
column="STUDY_ID" length="22" />
<key-property name="procstepId" type="java.math.BigDecimal"
column="PROCSTEP_ID" length="22" />
<key-property name="formdataSeq" type="java.math.BigDecimal"
column="FORMDATA_SEQ" length="22" />
</composite-id>



<property name="revId" type="java.math.BigDecimal"
column="REV_ID" length="22" />
<property name="patstepStartDate" type="java.sql.Timestamp"
column="PATSTEP_START_DATE" length="7" />
<property name="patstepFinishDate" type="java.sql.Timestamp"
column="PATSTEP_FINISH_DATE" length="7" />
<property name="patstepComplete" type="java.lang.String"
column="PATSTEP_COMPLETE" not-null="true" length="1" />
<property name="patstepCompleteByDate" type="java.sql.Timestamp"
column="PATSTEP_COMPLETE_BY_DATE" length="7" />
<property name="patstepNote" type="java.lang.String"
column="PATSTEP_NOTE" length="80" />

<property name="auditInfo" type="com.osi.model.general.AuditInfoType">
<column name="CREATED_DT"/>
<column name="CREATED_BY"/>
<column name="UPDATED_DT"/>
<column name="UPDATED_BY"/>
</property>

<property name="patstepStatus" type="java.lang.String"
column="PATSTEP_STATUS" not-null="true" length="1" />


<!--
<property name="form"
type="com.osi.business.util.FormTableMappingUserType"
access="field">
<column name="PATIENT_ID" />
<column name="STUDY_ID" />
<column name="PROCSTEP_ID" />
<column name="FORMDATA_SEQ" />
</property>
-->

<one-to-one name="data" constrained="true" class="ospoint.hibernate.FormDataBase"/>

<set name="status" table="RECORD_STATUS" >
<key>
<column name="PATIENT_ID"/>
<column name="STUDY_ID"/>
<column name="PROCSTEP_ID"/>
<column name="FORMDATA_SEQ"/>
</key>

<many-to-many
column="status"
class="ospoint.hibernate.RecordStatusDef"
outer-join="true"
/>
</set>


<!-- associations -->

<!-- here we have a set of data filters -->

<filter name="modifiedDateMin" condition="createdDt > :date"/>
<filter name="modifiedDateMax" >
<![CDATA[createdDt < :date]]>
</filter>

<filter name="createdDateMin" >
<![CDATA[createdDt > :date]]>
</filter>
<filter name="createdDateMax" >
<![CDATA[createdDt < :date]]>
</filter>





</class>
</hibernate-mapping>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.