public < E > E findById ( final Class < E > entityClass , final Object primaryKey ) { E e = find ( entityClass , primaryKey ) ; if ( e == null ) { return null ; } // Return a copy of this entity return ( E ) ( e ) ; }
Find object based on primary key either form persistence cache or from database