I have the following in my reveng.xml file. I have one-to-many association between two tables. I declare what I want as a property name for the collection on the many side. the <hbm2hbmxml> ant task instead creates TWO collections and I can't get it to NOT create the one it automatically inserts into the generated mapping file.
Hibernate version:
Hibernate Tools 3.1.0.beta5
Mapping documents:
portion of my revng.xml file:
Code:
<!-- ProjectedInterestRate -->
<table name="proj_int" class="ProjectedInterestRate">
<primary-key>
<key-column name="profile_name" property="profileName"/>
<key-column name="idx_code" property="indexCode"/>
<key-column name="month" property="month"/>
</primary-key>
<foreign-key constraint-name="ProjIdxToProfile" foreign-table="run_profile" >
<column-ref local-column="profile_name" foreign-column="profile_name" />
<set property="projectedInterestRates" exclude="false" />
</foreign-key>
</table>
<!-- RunProfile -->
<table name="run_profile" class="RunProfile">
<primary-key>
<key-column name="profile_name" property="profileName"/>
</primary-key>
</table>
Code between sessionFactory.openSession() and session.close():NA
Full stack trace of any exception that occurs:NA
Name and version of the database you are using:Sybase ASE v 12
The generated mapping files:In RunProfile.hbm.xml
Code:
<set name="projectedInterestRates" inverse="true">
<key>
<column name="profile_name" length="50" not-null="true" />
</key>
<one-to-many class="ProjectedInterestRate" />
</set>
<set name="projIntsForProfileName" inverse="true">
<key>
<column name="profile_name" length="50" not-null="true" />
</key>
<one-to-many class="ProjectedInterestRate" />
</set>
notice the
<set name="projIntsForProfileName" that was generated by itself. I can't seem to get rid of it. I can't manually edit it becuase the mapping file generation thorugh ant needs to be automatic. I could ofcourse add an ant task to go and edit the property value but I am still interested in why this is happening.
Debug level Hibernate log excerpt: