-->
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: Using joined-subclass
PostPosted: Thu Jul 28, 2005 8:54 pm 
Beginner
Beginner

Joined: Thu Jul 28, 2005 6:40 pm
Posts: 29
Hi;

I tripped over this so I'm posting for those that may also hit this.

When you create a table per subclass using <joined-subclass>, it works this way:

<class name="BaseClass">
<id name="baseClassPrimaryKey" ...>
<property .../>
...

<joined-subclass name="DerivedClass">
<key column="baseClassPrimaryKeyColumnName"/>
<property .../>
...

</joined-subclass>
</class>

The example I first read made me think it was the other way around.

One further note - no PK in the derived class, just the base class. The derived class has a column with the same name as the the PK in the base class, but do not set it as identity, just as a PK.

- dave


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.