Hi,
I am trying to map a join table between a regular table and another table which is being subclassed as given below:
ESignature *PK ESignatureID :int * SignerLoginName :nvarchar(250) * SignatureDate :datetime
DocumentFileStorage ( This is also being used as Collection by another Table Document ) *pfK DocumentID :int *pfK FileStorageID :uniqueidentifier *PK Version :int
And join table between ESignature and DocumentFileStorage ESignatureDocument *pK ESignatureDocumentID *pfK ESignatureID :int *pfK DocumentID :int *pfK Fil eStorageID :uniqueidentifier *pfK VersionID :int
I tried so many different ways to map the join table 'ESignatureDocument' but with no success. I am copying the mapping files as given below, which are definitely not correct after many updates: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping schema="dbo"> <class name="gov.nih.bmiss.domain.ESignatureDocument" table="ESignatureDocument"> <id name="eSignatureDocumentID" type="java.lang.Integer"> <column name="ESignatureDocumentID" /> <generator class="native" /> </id> <many-to-one name="eSignature" class="gov.nih.bmiss.domain.ESignature"> <column name="ESignatureID" not-null="true" /> </many-to-one> <many-to-one name="documentFileStorage"> <column name="DocumentID" not-null="true"/> <column name="FileStorageID" not-null="true" /> <column name="Version" not-null="true"/> </many-to-one> </class>
</hibernate-mapping> ----------------------------------
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping schema="dbo">
<class name="gov.nih.bmiss.domain.DocumentFileStorage" table="DocumentFileStorage">
<composite-id> <key-many-to-one name="document" class="gov.nih.bmiss.domain.Document"></key-many-to-one> <key-many-to-one name="fileStorage" class="gov.nih.bmiss.domain.FileStorage"></key-many-to-one> <key-property name="version"></key-property> </composite-id>
</class> </hibernate-mapping> ----------------------------------------- Could any one please tell me what is the correct way to map such join tables.
Thanks, Umesh Kant
|