-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Simple inheritance
PostPosted: Sun Feb 25, 2007 1:51 pm 
Newbie

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 ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.