Hibernate version:
3.0.5
Mapping documents:
Persistable.hbm
Code:
<hibernate-mapping>
<class name="Persistable">
<id name="id" type="long" unsaved-value="null">
<generator class="sequence">
<param name="sequence">persistable_id_sequence</param>
</generator>
</id>
</class>
</hibernate-mapping>
Versionable.hbmCode:
<hibernate-mapping>
<union-subclass
name="Versionable"
extends="Persistable">
<version name="version" type="long" unsaved-value="null"/>
</union-subclass>
</hibernate-mapping>
Source code:Persistable.javaCode:
public interface Persistable {
Long getId();
void setId(Long newValue);
}
Versionable.javaCode:
public interface Versionable extends Persistable {
Long getVersion();
void setVersion(Long newValue);
}
Error:
When configuring Versionable.hbm - 'The content of element type "union-subclass" must match...' (ie the version element is not valid within a union-subclass element).
Question:
As far as I understand from the details above the current version of the hibernate mapping DTD does not support use of the 'version' element within a 'union-subclass'. Are there any plans to support this configuration in the future? If not, am I correct in thinking that the only way to support the interface hierarchy described above would be via '
Table per concrete class, using implicit polymorphism'?