-->
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.  [ 2 posts ] 
Author Message
 Post subject: Union subclass mapping.
PostPosted: Mon Jan 25, 2010 3:25 am 
Newbie

Joined: Mon Jan 25, 2010 3:11 am
Posts: 2
Hi, everyone.

I've got a problem with Hibernate union-subclass mapping. Sorry, I've changed table and entity names but the whole meaning is the same.
The problem is that the properties of particular union subclass are not being resolved at all. I get nulls when I try to get vendorConfirmationNum from some.entity.ChildEntityTwo, though I've executed queries from hibernate SQL logs for this entity. I tried to map lazy="true" but this doesn't help at all.


Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
                                   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class name="some.entity.AbstractEntity" table="RESERVATION" abstract="true">
    <id column="RESERVATION_ID" name="ID" unsaved-value="0">
      <generator class="assigned"/>
    </id>
    <property column="NO_SHOW" name="noShow"/>

    <union-subclass name="some.entity.ChildEntityOne" table="RESERVATION_BEGIN"/>
    <union-subclass name="some.entity.ChildEntityTwo" table="RESERVATION_CONFIRM">
      <property column="VENDOR_CONFIRMATION_NUM" name="vendorConfirmationNum"/>
      <property column="CANCELLED_IND" name="cancelledInd"/>
    </union-subclass>
  </class>
</hibernate-mapping>


Did anyone have a problem like this? If more information needed - just ask. Thanks.


Top
 Profile  
 
 Post subject: Re: Union subclass mapping.
PostPosted: Fri Jan 29, 2010 12:23 pm 
Newbie

Joined: Mon Jan 25, 2010 3:11 am
Posts: 2
That is strange. Do I have to implement my own entityResolver?


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

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.