protected < E extends Identifiable > E findEntity ( EntityManager em , BigInteger id , Class < E > type ) { requireArgument ( em != null , "The entity manager cannot be null." ) ; requireArgument ( id != null && id . compareTo ( ZERO ) > 0 , "ID must be positive and non-zero" ) ; requireArgument ( type != null , "The entity cannot be null." ) ; em . getEntityManagerFactory ( ) . getCache ( ) . evictAll ( ) ; return em . find ( type , id ) ; }
Locates an entity based on it s primary key value .