code: @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;
      }
docs: Persists the specified PersistenceCapable object.
  @param object a PersistenceCapable object
  @param <T> the type to return
  @return the persisted object