@ SuppressWarnings ( "unchecked" ) private T getAttached ( T object ) { if ( entityManager . contains ( object ) ) { return object ; } else { return findOne ( ( I ) entityManager . getEntityManagerFactory ( ) . getPersistenceUnitUtil ( ) . getIdentifier ( object ) ) ; } }
Gets the managed version of the given entity instance .