Changed code that checks class equality of persistent objects to use the persistent class for hibernate proxies