Hi!
Lets say I have an hbm like this:
<class
name="mx.lania.extranet.domainmode.Group"
table="groups"
>
<id
name="id"
type="int"
column="id"
>
<generator class="sequence">
<param name="sequence">group_id_seq</param>
</generator>
</id>
<property
name="name"
type="java.lang.String"
column="name"
not-null="true"
length="50"
/>
</class>
It will normally generate a somewhat class like this:
public class Group implements Serializable {
public Group() {
}
public java.lang.Integer getId() {
return this.id;
}
public void setId(java.lang.Integer id) {
this.id = id;
}
public java.lang.String getName() {
return this.name;
}
public void setName(java.lang.String value) {
this.name =value;
}
}
but I want it to generate 2 class, one with de persisten propeties (an or relationships) and another, for me to write my particular bussines logic:
//In SuperGroup.java
public class SuperGroup implements Serializable {
public BaseGroup() {
}
public java.lang.Integer getId() {
return this.id;
}
public void setId(java.lang.Integer id) {
this.id = id;
}
public java.lang.String getName() {
return this.name;
}
public void setName(java.lang.String value) {
this.name =value;
}
}
//In Group.java
public class Group extends SuperGroup {
}
This way, i can regenerate my .java very every time that i feel like it
without the risk of loosing my custom bussines logic (yes, I know i can marge, and restore old CVS versions of my work, but this way it would be SO much easier, I miss
http://www.rubicode.com/Software/EOGenerator/ from my EOF times) if this is not supported I think i shouldt be so hard to do it, if someone gives me some hits about what classes/methods in hbm2java i have to modify I'd be glad to contribute this back to the community.
bye
Luxspes