@SuppressWarnings("unchecked")
    public <T> T persist(T object) {
        pm.currentTransaction().begin();
        pm.makePersistent(object);
        pm.currentTransaction().commit();
        pm.getFetchPlan().setDetachmentOptions(FetchPlan.DETACH_LOAD_FIELDS);
        pm.refresh(object);
        return object;
    }
@ SuppressWarnings ( "unchecked" ) public < T > T persist ( T object ) { pm . currentTransaction ( ) . begin ( ) ; pm . makePersistent ( object ) ; pm . currentTransaction ( ) . commit ( ) ; pm . getFetchPlan ( ) . setDetachmentOptions ( FetchPlan . DETACH_LOAD_FIELDS ) ; pm . refresh ( object ) ; return object ; }
Persists the specified PersistenceCapable object.
@param object a PersistenceCapable object
@param <T> the type to return
@return the persisted object