-->
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: union-subclass mapping in Hibernate3
PostPosted: Mon Mar 21, 2005 12:28 pm 
Newbie

Joined: Mon Mar 21, 2005 12:19 pm
Posts: 2
I tried the following mapping
Code:
    <class name="Actor" abstract="true">
       
        <id name="identifier" type="long">
            <generator class="hilo" />
        </id>
        <version name="entityRevision" />
       
        <union-subclass name="Group" table="UserGroup">
            <property name="name" type="string" unique="true"/>
            <many-to-one name="parentGroup" />
            <set name="childrenGroups" inverse="true">
                <key property-ref="parentGroup" />
                <one-to-many class="Group" />
            </set>
        </union-subclass>

        <union-subclass name="User">
            <property name="disabled" type="boolean" />
            <property name="eMail" type="string"/>
            <property name="accountName" type="string" />
            <property name="fullName" type="string" />
            <property name="encPassword" type="string" />
        </union-subclass>
    </class>


with HSQLDB dialect and I obtain the following:
Code:
3766 ERROR org.hibernate.tool.hbm2ddl.SchemaExport
  Unsuccessful: alter table UserGroup add constraint FK8A5BE15445D99518 foreign key (parentGroup) references UserGroup
3776 ERROR org.hibernate.tool.hbm2ddl.SchemaExport
  Constraint not foundtable has no primary key in statement [alter table UserGroup add constraint FK8A5BE15445D99518 foreign key (parentGroup) references UserGroup]


Is it correct? It looks really similar to the documentation example to me what I did wrong?

Thank you very much,

Davide


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.