[quote="esword"]You can use xdoclet to generate a mapping file like you have shown, but only if all mappings are generated by xdoclet and generated at the same time.
Yes that's clear, in former times I write all my hbm.xml files self, now I want do this job by xdoclet. But when I define my interface and my classes :
Code:
/**
* @hibernate.class table="data"
*/
public interface AdditionalData
Code:
[
/**
* @hibernate.joined-subclass table="data"
* @hibernate.joined-subclass-key column="id"
*/
public class Enquiry implements AdditionalData
Now when I run xdoclet generation I get the AdditionalData.hbm.xml
without the subclass definitions from the class Enquiry.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="de.chris.AdditionalData" table="data">
<id name="id" column="id" type="java.lang.Long">
<generator class="native">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-AdditionalData.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<discriminator column="type" />
<many-to-one name="person" class="de.chris.Person" cascade="none" outer-join="auto" update="true" insert="true" column="PERSON_ID" />
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-AdditionalData.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
So I wonder have I make a mistake or will xdoclet force me to implement my interface by an abstract class (e.g. AbstractAdditionalData) to have the possibility to manage my data with through hibernate.