Hibernate/JPA

Problem with entity id's and equals() in proxies


Make sure that getId() of the entity is NOT made final. CGLib proxies can NOT override a final 'getId()' method! Also make sure that you don't check on getClass(), as that sure won't match for a proxy. Instead check with instanceOf().