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
|