Fix bug in method "getRid(Object entity)"