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.