|
From: Ricardo P. (JIRA) <nh...@gm...> - 2011-06-07 06:11:14
|
SchemaUpdate Generates Additional Relations Mandatory on Both Endpoints
-----------------------------------------------------------------------
Key: NH-2761
URL: http://216.121.112.228/browse/NH-2761
Project: NHibernate
Issue Type: Bug
Components: Tests
Affects Versions: 3.2.0Beta1
Reporter: Ricardo Peres
Attachments: bd.png, NHTest.zip
SchemaUpdate generates invalid schema. Additional relations, mandatory on both sides, are added to the following mapping (also attached), please see the attached picture:
<hibernate-mapping default-lazy="false" namespace="NHTest" assembly="NHTest" xmlns="urn:nhibernate-mapping-2.2">
<class name="A" lazy="false" table="`A`">
<id name="Id" access="property" column="`A_ID`">
<generator class="hilo" />
</id>
<property name="AProperty" column="`A_PROPERTY`" length="50"/>
<many-to-one name="B" class="B" column="`B_ID`" not-null="false" />
<many-to-one name="C" class="C" column="`C_ID`" not-null="false" />
</class>
</hibernate-mapping>
<hibernate-mapping default-lazy="false" namespace="NHTest" assembly="NHTest" xmlns="urn:nhibernate-mapping-2.2">
<class name="B" lazy="false" table="`B`">
<id name="Id" access="property" column="`B_ID`">
<generator class="hilo" />
</id>
<property name="BProperty" column="`B_PROPERTY`" length="50"/>
<set name="As" inverse="true">
<key column="`B_ID`"/>
<one-to-many class="A"/>
</set>
<many-to-one name="C" class="C" column="`C_ID`" not-null="false" fetch="select"/>
</class>
</hibernate-mapping>
<hibernate-mapping default-lazy="false" namespace="NHTest" assembly="NHTest" xmlns="urn:nhibernate-mapping-2.2">
<class name="C" lazy="false" table="`C`">
<id name="Id" access="property" column="`C_ID`">
<generator class="hilo" />
</id>
<property name="CProperty" column="`C_PROPERTY`" length="50"/>
<set name="As" inverse="true">
<key column="`A_ID`"/>
<one-to-many class="A"/>
</set>
<set name="Bs" inverse="true">
<key column="`B_ID`"/>
<one-to-many class="B"/>
</set>
</class>
</hibernate-mapping>
A test case is included which only generates the schema.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|