Here are example of solution. But there is one problem. I would like to define table (table name) for joined subclass. How can I do it using xdoclet hibernate tags?
In base.hbm.xml should be added line with bold. This line is missing after hbm generation of this example.
<joined-subclass
name="com.pxpfs.excom2.finance.domainmodel.BaseExpert"
table="A_BASE_EXPERT_TBL"
dynamic-update="false"
dynamic-insert="false"
>
BASE class
Code:
/**
* @hibernate.class table="A_BASE_TBL"
*/
public class Base implements java.io.Serializable {
public Long baseId;
public String name;
public void setBaseId(Long baseId) {
this.baseId = baseId;
}
/**
* @hibernate.id generator-class="native"
*/
public Long getBaseId() {
return baseId;
}
public void setName(String name) {
this.name = name;
}
/**
* @hibernate.property length="60"
*/
public String getName() {
return name;
}
public Base() {
super();
}
}
ANCESTOR CLASS - JOINED SUBCLASS
Code:
/**
* not good !!!! @ hibernate.class table="A_BASE_EXPERT_TBL"
* @hibernate.joined-subclass table="A_BASE_EXPERT_TBL"
* @hibernate.joined-subclass-key column="baseId"
*/
public class BaseExpert extends Base implements java.io.Serializable {
public String description;
public void setDescription(String description) {
this.description = description;
}
/**
* @hibernate.property length="60"
*/
public String getDescription() {
return description;
}
public BaseExpert() {
super();
}
}