find

Die Methode <T> T find(Class<T> entityClass, Object primaryKey) gehört zum EntityManager Interface. Mit ihr kann ein Objekt über seinen Primary Key gelesen werden.

/**
* Find by primary key.
* @param entityClass
* @param primaryKey
* @return the found entity instance or null
* if the entity does not exist
* @throws IllegalArgumentException if the first argument does
* not denote an entity type or the second
* argument is not a valid type for that
* entity’s primary key
*/