Calling EntityManager#find and EntityManager.getReference with an object that is not an entity results in: org.hibernate.HibernateException: Unable to locate persister:
IllegalArgumentException should be thrown instead.