-->
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: NHibernate one to one mapping problem
PostPosted: Wed May 24, 2006 7:41 am 
Newbie

Joined: Wed May 17, 2006 7:06 pm
Posts: 3
Hi,

I have 2 tables that is used for lookup. A table called order use these two tables to do lookups. I map the two tables one-one mapping with order. However, when i try to do a HQL query, i seem to be getting an error.

below is the xml mapping file for the 3 files. thanks

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Nhg.Aurora.Plato.Business.Common.Entity.Lab.OrderCategoryType, Nhg.Aurora.Plato.Business.Common" table="AUR_ORDER_CATEGORY_TYPE" lazy="true" >
<id name="AurId" column="AUR_ID" access="nosetter.camelcase">
<generator class="native"/>
</id>
<property name="CategoryCode" column="ORDER_CATEGORY_CODE"></property>
<property name="CategoryName" column="ORDER_CATEGORY_NAME"></property>
<one-to-one name="Order" class="Nhg.Aurora.Plato.Business.Common.Entity.Lab.Orders,Nhg.Aurora.Plato.Business.Common" property-ref="OrderCategoryType" cascade="none" />
</class>
</hibernate-mapping>

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Nhg.Aurora.Plato.Business.Common.Entity.Lab.OrderItemType, Nhg.Aurora.Plato.Business.Common" table="AUR_ORDER_ITEM_TYPE" lazy="true" >
<id name="AurId" column="AUR_ID" access="nosetter.camelcase">
<generator class="native"/>
</id>
<property name="OrderItemCode" column="ORDER_ITEM_CODE"></property>
<property name="OrderItemName" column="ORDER_ITEM_NAME"></property>
<one-to-one name="Order" class="Nhg.Aurora.Plato.Business.Common.Entity.Lab.Orders,Nhg.Aurora.Plato.Business.Common" property-ref="OrderItemType" cascade="none" />
</class>
</hibernate-mapping>

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Nhg.Aurora.Plato.Business.Common.Entity.Lab.Orders,Nhg.Aurora.Plato.Business.Common" table="AUR_ORDER" lazy="true" >
<id name="AurId" column="AUR_ID" access="nosetter.camelcase">
<generator class="native"/>
</id>
<many-to-one name="OrderItemType" class="Nhg.Aurora.Plato.Business.Common.Entity.Lab.OrderItemType, Nhg.Aurora.Plato.Business.Common" column="ORDERITEMCODEID" unique="true" />
<many-to-one name="OrderCategoryType" class="Nhg.Aurora.Plato.Business.Common.Entity.Lab.OrderCategoryType, Nhg.Aurora.Plato.Business.Common" column="ORDERCATEGORYTYPEID" unique="true"/>
</class>
</hibernate-mapping>


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.