Joined: Mon Jan 08, 2007 7:57 am Posts: 6
|
Hi
I am trying to implement a symple inheritance between 2 tables without success.
THe first object is
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="Test.Lib">
<class name="Test.Lib.SKU" table="SKUs">
<id name="code" type="int" length="4">
<generator class="NHibernate.Id.TableHiLoGenerator">
<param name="table">CodeIdGenerator</param>
<param name="column">SKUs</param>
<param name="max_lo">0</param>
</generator>
</id>
<property name="setSysId" type="int" length="4"/>
<property name="supportsEventReporting" type="Boolean" />
</class>
</hibernate-mapping>
now, the second object is called Package and the table has the same key as SKUs.
I've tried this:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.0"
assembly="Test.Lib">
<class name="Test.Lib.Package" table="GC_Packages" polymorphism="implicit" >
<id name="code" column="intSkuDode" type="int" length="4">
<generator class="assigned">
</generator>
</id>
<property name="PackageName" column ="strPackageName" type="string" length="255"/>
<property name="updatedAt" column="dateLastUpdate" type="DateTime" not-null="true"/>
<property name="createdAt" column="dateCreated" type="DateTime" not-null="true"/>
</class>
</hibernate-mapping>
When I generate the code from the hbm with NHibernate.Tool.hbm2net.Console.exe and added " : SKU" to the package class but got error on hiding the code field.
what am I doing wrong ?
|
|