When I take your example and run it with the current version of hbm2java i get:
Code:
package hibernate.src;
import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class Utilisateur implements Serializable {
/** identifier field */
private java.lang.Long id;
/** nullable persistent field */
private java.lang.String login;
/** nullable persistent field */
private java.lang.String mdp;
/** full constructor */
public Utilisateur(java.lang.String login, java.lang.String mdp) {
this.login = login;
this.mdp = mdp;
}
/** default constructor */
public Utilisateur() {
}
public java.lang.Long getId() {
return this.id;
}
public void setId(java.lang.Long id) {
this.id = id;
}
public java.lang.String getLogin() {
return this.login;
}
public void setLogin(java.lang.String login) {
this.login = login;
}
public java.lang.String getMdp() {
return this.mdp;
}
public void setMdp(java.lang.String mdp) {
this.mdp = mdp;
}
public String toString() {
return new ToStringBuilder(this)
.append("id", getId())
.toString();
}
public boolean equals(Object other) {
if ( !(other instanceof Utilisateur) ) return false;
Utilisateur castOther = (Utilisateur) other;
return new EqualsBuilder()
.append(this.getId(), castOther.getId())
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder()
.append(getId())
.toHashCode();
}
}
And that includes the identifier....
What version are you using ?
/max