http://www.hibernate.org/hib_docs/annotations/reference/en/html/entity.html#d0e602
@EmbeddableSuperclass
public class EntityBean {
Integer id;
@Id(generate = GeneratorType.AUTO)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Override
public boolean equals(Object obj) {
if (id == null)
return super.equals(obj);
else return id.equals(((EntityBean) obj).id);
}
@Override
public int hashCode() {
if (id == null)
return super.hashCode();
else
return id.hashCode();
}
}