Interesting.
I just re-ran my build script and I'm def. not getting hashCode and equals:
Code:
public class RolesCompositeId implements java.io.Serializable {
// Fields
private Integer userId;
private Roles roles;
// Constructors
/** default constructor */
public RolesCompositeId() {
}
// Property accessors
/**
*
*/
public Integer getUserId() {
return this.userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
*
*/
public Roles getRoles() {
return this.roles;
}
public void setRoles(Roles roles) {
this.roles = roles;
}
}
Are you calling hbm2java the same way as me?
Code:
<target name="hbm2java" depends="build-user-types" description = "Generate Java source from the O/R mapping files">
<taskdef name = "hibernatetool"
classname = "org.hibernate.tool.ant.HibernateToolTask"
classpathref = "master-classpath"/>
<hibernatetool destdir="${src.dir}">
<configuration configurationfile="hibernate.cfg.xml" />
<hbm2java/>
</hibernatetool>
</target>
I guess the most recent CVS snapshot has functionality to generate those methods. I'm not even sure how to pull that rev. from the Hiberante downloads area.
It probably doesn't matter anyway as I'm going to change my table definition to contain a unique id. Just seems easier to work with Hibernate that way.
Thanks so much for you note.