-->
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: Problems with mapping <one-to-many> of inherited class
PostPosted: Fri Aug 01, 2008 5:31 am 
Newbie

Joined: Fri Aug 01, 2008 5:18 am
Posts: 1
I have next problem, I have class hierarchy TechnoCardItemInput and TechnoCardItemOutput are inherited from base TechnoCardItem, and mapped using "Table per class hierarchy" method.


Another class TechnoCard has collections of TechnoCardItemInput and TechnoCardItemOutput as properties and mapping file has following declarations:
Code:
<bag name="Input" cascade="all" inverse="true">
      <key column="TechnoCardID" />
      <one-to-many class="DeliveryNoteHandler.Core.Domain.TechnoCardItemInput, DeliveryNoteHandler.Core" />
</bag>

<bag name="Output" cascade="all" inverse="true">
      <key column="TechnoCardID" />
      <one-to-many class="DeliveryNoteHandler.Core.Domain.TechnoCardItemOutput, DeliveryNoteHandler.Core" />
</bag>


When loading TechnoCard from database the next error occurs:
"Object with id: 3 was not of the specified sublcass: DeliveryNoteHandler.Core.Domain.TechnoCardItemInput (loading object was of wrong class [DeliveryNoteHandler.Core.Domain.TechnoCardItemOutput])"

How can I solve this problem?


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.