Implemented hashCode and equals for Hibernate composite key support.