Sorry if you guys already know about this.. but I just started using Hibernate and thought I was going mad for a while.
Latest version 3.5.0-final.
org.hibernate.type.EntityType.isEqual(Object,Object,EntityMode,SessionFactoryImplementor)line 353 in my source
Spot the x below
Code:
Serializable yid;
if (y instanceof HibernateProxy) {
yid = ( (HibernateProxy) y ).getHibernateLazyInitializer()
.getIdentifier();
}
else {
if ( mappedClass.isAssignableFrom( y.getClass() ) ) {
yid = persister.getIdentifier(x, entityMode);
}
else {
//JPA 2 case where @IdClass contains the id and not the associated entity
yid = (Serializable) y;
}
}