-->
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: Is it possible to use version with union-subclass?
PostPosted: Tue Jul 26, 2005 8:19 am 
Newbie

Joined: Wed Jun 16, 2004 6:49 am
Posts: 4
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.hbm
Code:
<hibernate-mapping>
   <union-subclass
      name="Versionable"
      extends="Persistable">
   
      <version name="version" type="long" unsaved-value="null"/>
      
   </union-subclass>
</hibernate-mapping>


Source code:
Persistable.java
Code:
public interface Persistable {
    Long getId();
    void setId(Long newValue);
}


Versionable.java
Code:
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'?


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.