Checking if obj is Hibernate entity