Hi !
I have a problem.
I have two entities :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.2"
default-cascade="none">
<class
name="Entites.Structures.Contenu, Core"
table="CONTENU"
dynamic-insert="false"
dynamic-update="false"
lazy="true">
<cache usage="read-write" />
<id name="Id" type="Int64" unsaved-value="null">
<column name="ID" sql-type="BIGINT"/>
<generator class="assigned">
</generator>
</id>
………….
</class>
</hibernate-mapping>
Code:
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.2"
default-cascade="none">
<class
name="Entites.Suivis.EtatContenu, Core"
table="ETAT_CONTENU"
dynamic-insert="false"
dynamic-update="false"
lazy="true">
<cache usage="read-write" />
<id name="Id" type="Int64" unsaved-value="0">
<column name="ID" sql-type="BIGINT"/>
<generator class="native">
</generator>
</id>
……….
<many-to-one name="Contenu" class="Entites.Structures.Contenu, Core" outer-join="auto" foreign-key="ETAT_CONTENU_CONTENU_FKC">
<column name="CONTENU_FK" not-null="true" sql-type="BIGINT"/>
</many-to-one>
</class>
</hibernate-mapping>
I have two objects :
Code:
moncontenu (type Contenu)
monetat (type EtatContenu)
monetat.Contenu = moncontenu;
When I delete moncontenu, I get error deleting :
Quote:
ERROR NHibernate.Util.ADOExceptionReporter NHibernate.Util.ADOExceptionReporter - L'instruction DELETE est en conflit avec la contrainte REFERENCE 'ETAT_CONTENU_CONTENU_FKC'. Le conflit s'est produit dans la base de données 'xxxxx', table 'xxxxx.ETAT_CONTENU', column 'CONTENU_FK'.
Any ideas would be greatly appreciated.