-->
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: Inheritance
PostPosted: Fri Sep 23, 2011 7:24 am 
Newbie

Joined: Wed Jan 16, 2008 6:25 pm
Posts: 4
Hi,

we have a "util-project" that is included in a few other projects.
In the util-project, I have an abstract class I want to use in a "table per class hierarchy” strategy in the other
projects.
So I would like to define all attributes of the abstract class in a hbm.xml file in the util project,
then I would like to somehow reference this information in the hbm files in the respective sub projects.

I found examples such as:
<hibernate-mapping>

<class name=”Employee” table=”EMP”>

<id name=”id” column=”EMP_ID” type=”long”>

<generator class=”native” />

</id>

<property name=”employeeName” column=”EMP_NAME” />

<property name=”location” column=”LOCATION” />

<joined-subclass name=”RegularEmployee” table=”REG_EMP” >

<key column=”EMP_ID” />

<property name=”salary” column=”SALARY” />

<property name=”bonus” column=”BONUS” />

</joined-subclass>

<joined-subclass name=”RegularEmployee” table=”REG_EMP” >

<key column=”EMP_ID” />

<property name=”hourlyRate” column=”RATE” />

<property name=”perDiemRate” column=”PER_DIEM” />

<property name=”contractPeriod” column=”CON_PERIOD” />

</joined-subclass>

</class>

</hibernate-mapping>

But for this I would have to define the subclasses directly in the util project -
but the other projects should be dependend on this util-project, and not vice versa - so the util
project should not have any information about the projects that use it.

Is there any way of achieving this?

Thanks,

Marcus


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.