I am gettin this exception when trying to add a subclass into my exsisting class.
none of my C# classes actually contain a repwated property however my database dose store repeated information. This is because the project is adding onto an exsiting schema.
the
ID, Entry_Date and EFT_INFO_ID colums are repeted in both tables.
can anyone see what i have done wrong !!?.
Also have i got the concept of inheritance correct for nhibinate? If i have a class that inherits data from another, should they share a primary key.(ie the key is both a PK and a FK) ?
Ideally the ATD class should be adstract and only have instance of ATDImage and ATDwww (when i write it next). I am fairly new to nhibernate and these concepts havent been cemented yet.
Mapping documents:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" namespace="ATDService" assembly="ATDService">
<class name="ATD" table="ATD_PARENT" discriminator-value="NEVER">
<id name="Id">
<column name="Id" sql-type="int(4)" not-null="true" />
<generator class="identity" />
</id>
<discriminator column="TYPE"/>
<property name="EftInfoId">
<column name="EFT_INFO_ID" sql-type="int(4)" not-null="true" />
</property>
<property name="Type">
<column name="TYPE" sql-type="nvarchar(10)" not-null="true" />
</property>
<property name="User">
<column name="Entry_user" sql-type="nvarchar(50)" not-null="true" />
</property>
<property name="EntryDate">
<column name="Entry_Date" sql-type="datetime" not-null="true" />
</property>
<subclass name="ATDImage" table="ATD_INFO" discriminator-value="IMG">
<property name="Image">
<column name="Atd_picture" sql-type="image" not-null="true" />
</property>
</subclass>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
"Repated column in mapping for class ATDImage should be mapped with insert="false" update="false"
Thanks