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: Question on mixing inheritance strategies
PostPosted: Wed Feb 07, 2007 12:15 pm 
Newbie

Joined: Tue Feb 06, 2007 10:49 am
Posts: 3
Hi: all:

I am developing 3 classes, and they look like this:

Class A{

long id;

.....
}

Class B extends A {

String name;

....
}

For this inheritence, I am using table-per-class-hierarchy by using <subclass>, the mapping file looks like this:

<class
name="A"
table="ATable"
>
<id
name="id"
column="Id"
type="long"
unsaved-value="-1"
>
<generator class="native"/>
</id>

<discriminator
column="Type"
not-null="true"
type="string"
length="10"
/>

<version
name="version"
column="Version"
type="java.lang.Integer"
/>

<subclass
name="B"
discriminator-value="btype"
>

<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
/>

</subclass>
</class>

Now I create another class C:

Class C extends B {

Date created;

.....
}

Now my question is: since class A and B are using table-per-class-hierarchy, can I use table-per-concrete-class for class C?


Any response will be appreciated!


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.