Package javax.jdo

Examples of javax.jdo.Query.deletePersistentAll()


  private void dropPartitionsNoTxn(String dbName, String tblName, List<String> partNames) {
    ObjectPair<Query, Map<String, String>> queryWithParams =
        getPartQueryWithParams(dbName, tblName, partNames);
    Query query = queryWithParams.getFirst();
    query.setClass(MPartition.class);
    long deleted = query.deletePersistentAll(queryWithParams.getSecond());
    LOG.debug("Deleted " + deleted + " partition from store");
    query.closeAll();
  }

  /**
 
View Full Code Here


  private void dropPartitionsNoTxn(String dbName, String tblName, List<String> partNames) {
    ObjectPair<Query, Map<String, String>> queryWithParams =
        getPartQueryWithParams(dbName, tblName, partNames);
    Query query = queryWithParams.getFirst();
    query.setClass(MPartition.class);
    long deleted = query.deletePersistentAll(queryWithParams.getSecond());
    LOG.debug("Deleted " + deleted + " partition from store");
    query.closeAll();
  }

  /**
 
View Full Code Here

    Long curTime = System.currentTimeMillis();
    try {
      openTransaction();
      Query query = pm.newQuery(MPartitionEvent.class,"curTime - eventTime > expiryTime");
      query.declareParameters("java.lang.Long curTime, java.lang.Long expiryTime");
      delCnt = query.deletePersistentAll(curTime, expiryTime);
      commited = commitTransaction();
    }
    finally {
      if (!commited) {
        rollbackTransaction();
View Full Code Here

        try {
            debugSql( sql, params );

            q = getQueryCond( cond );

            return (int) q.deletePersistentAll( params );
        }
        catch (JDOException e) {
            errorSql( e, sql, params );

            handleException( e );
View Full Code Here

    Long curTime = System.currentTimeMillis();
    try {
      openTransaction();
      Query query = pm.newQuery(MPartitionEvent.class,"curTime - eventTime > expiryTime");
      query.declareParameters("java.lang.Long curTime, java.lang.Long expiryTime");
      delCnt = query.deletePersistentAll(curTime, expiryTime);
      commited = commitTransaction();
    }
    finally {
      if (!commited) {
        rollbackTransaction();
View Full Code Here

    PersistenceManager pm = PMF.get().getPersistenceManager();
    Query q = createSingleSelectQuery(pm);
    try {
      // loadMindmap also does a security check
      if (loadMindmap(key) != null)
        q.deletePersistentAll(KeyFactory.stringToKey(key));
    } finally {
      pm.close();
    }
  }
View Full Code Here

    Long curTime = System.currentTimeMillis();
    try {
      openTransaction();
      Query query = pm.newQuery(MPartitionEvent.class,"curTime - eventTime > expiryTime");
      query.declareParameters("java.lang.Long curTime, java.lang.Long expiryTime");
      delCnt = query.deletePersistentAll(curTime, expiryTime);
      commited = commitTransaction();
    }
    finally {
      if (!commited) {
        rollbackTransaction();
View Full Code Here

    Query q = pm.newQuery(query);
   
    try {
      List<Object> results;
      if (delete != null) {
        long numDeleted = q.deletePersistentAll();
        results = ImmutableList.<Object>of("Deleted " + numDeleted + " entities");
        Caches.clearAll();
      } else {
        results = ImmutableList.copyOf((List<Object>) q.execute());
      }
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.