Hibernate version:
1.2.0.GA
I have the same problems that were described here:
http://jira.nhibernate.org/browse/NH-343
I have one table with composite key:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Core.Domain.CatalogObject, Core" table="dbo.[CatalogObject]" lazy="false">
<composite-id access="field">
<key-property name="CatalogObjectId" column="CatalogObjectId" type="Int32" />
<key-property name="CultureId" column="CultureId" type="Int32" />
</composite-id>
<many-to-one name="CatalogObjectType" column="CatalogObjectTypeId" class="Core.Domain.CatalogObjectType, Core" />
<property column="Name" type="String" name="Name" not-null="true" length="100" />
</class>
</hibernate-mapping>
and another referencing to it with more than 1 FK:
Code:
<many-to-one name="TransportationDocumentsType" class="Core.Domain.CatalogObject, Core">
<column name="TransportationDocumentsTypeId" />
<column name="CultureId" />
</many-to-one>
<many-to-one name="CarType" class="Core.Domain.CatalogObject, Core">
<column name="CarTypeId" />
<column name="CultureId" />
</many-to-one>
nHibernate generates query with N CultureId inserts. Why NH-343 is closed? Is there walk around or it is unimportant? :)