Package javax.jdo

Examples of javax.jdo.PersistenceManager.detachCopy()


        adminConfig = pm.detachCopy(adminConfigs.get(0));
      } else {
        LOG.info("No admin config found in datastore.  Creating a new one.");
        adminConfig = new AdminConfig();
        pm.makePersistent(adminConfig);
        adminConfig = pm.detachCopy(adminConfig);
      }
    } catch (JDOObjectNotFoundException e) {
      // this path can only occur when there is model class errors (model binary
      // mistmatch in store)
      LOG.log(Level.WARNING, "Query cannot be executed against AdminConfig model class. "
View Full Code Here


  @Override
  public AdminConfig save(AdminConfig adminConfig) {
    PersistenceManager pm = pmf.getPersistenceManager();
    try {
      adminConfig = pm.makePersistent(adminConfig);
      adminConfig = pm.detachCopy(adminConfig);
    } finally {
      pm.close();
    }
    return adminConfig;
  }
View Full Code Here

    submission.setStatus(newStatus);
    submission.setUpdated(new Date());
    PersistenceManager pm = pmf.getPersistenceManager();
    try {
      submission = pm.makePersistent(submission);
      submission = pm.detachCopy(submission);
    } finally {
      pm.close();
    }

    switch (newStatus) {
View Full Code Here

  @Override
  public VideoSubmission save(VideoSubmission submission) {
    PersistenceManager pm = pmf.getPersistenceManager();
    try {
      pm.makePersistent(submission);
      submission = pm.detachCopy(submission);
    } finally {
      pm.close();
    }
    return submission;
  }
View Full Code Here

    query.declareParameters("String id_");
    List<UserSession> list = (List<UserSession>) query.executeWithArray(new Object[] { id });

    if (list.size() > 0) {
      userSession = list.get(0);
      userSession = pm.detachCopy(userSession);
    }

    pm.close();
   
    NamespaceManager.set(oldNamespace);
View Full Code Here

      if (!util.isNullOrEmpty(username)) {
        Query query = pm.newQuery(UserAuthToken.class, "youtubeName == username");
        query.declareParameters("String username");
        List<UserAuthToken> results = (List<UserAuthToken>) query.execute(username);
        if (results.size() > 0) {
          return pm.detachCopy(results.get(0));
        }
      }
    } finally {
      pm.close();
    }
View Full Code Here

  public Object persistJdo(Object entry) {
    PersistenceManager pm = pmf.getPersistenceManager();

    try {
      entry = pm.makePersistent(entry);
      entry = pm.detachCopy(entry);
    } finally {
      pm.close();
    }

    return entry;
View Full Code Here

  protected <T extends BaseObject<T,PE>, PE extends PropertyEnum<PE,T>>
  T add(T b) {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
      pm.makePersistent(b);
      b = pm.detachCopy(b);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      pm.close();
    }
View Full Code Here

                tx.commit();

                return null;
            }

            Object object = pm.detachCopy( result.iterator().next() );

            tx.commit();

            return (Installation) object;
        }
View Full Code Here

                tx.commit();

                return null;
            }

            Object object = pm.detachCopy( result.iterator().next() );

            tx.commit();

            return (Project) object;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.