-->
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.  [ 3 posts ] 
Author Message
 Post subject: could not get table per concrete class
PostPosted: Fri May 25, 2007 2:06 am 
Beginner
Beginner

Joined: Thu May 17, 2007 2:41 pm
Posts: 48
I use the following hbm to get table per concrete class

<hibernate-mapping >

<class name="model.Activity" abstract="true" >
<id name="objectId" type="int" column="OBJECTID">
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value</param>
<param name="max_lo">100</param>
</generator>
</id>

<property name="name" column="NAME" />

<union-subclass name="model.Event" table="Event">
<property name="description" column="DESCRIPTION" />
</union-subclass>


<union-subclass name="model.Task" table="Task">

<property name="type" column="TYPE" />
</union-subclass>

</class>


</hibernate-mapping>

But I end up with 3 tables. the super class Activity gets its own table with column 'name'. why does I get just two tables for just the two subclasses?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 25, 2007 2:30 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

Are you sure that your model.Activity is a abstract ?

So how would you end up a table Activity. If there is a table mapped with model.Activity you should mention it in
Code:
<class name="model.Activity" abstract="true" >
. and remove your abstraction.


Amila

(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 25, 2007 1:35 pm 
Beginner
Beginner

Joined: Thu May 17, 2007 2:41 pm
Posts: 48
you are right on there.

there is a discrepancy between my hbm and the java class, which does not have the abstract qualifier.

Thanks for the tip.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.