Package javax.jdo

Examples of javax.jdo.Query.executeWithMap()


    return (Collection) execute(new JdoCallback() {
      public Object doInJdo(PersistenceManager pm) throws JDOException {
        Query query = pm.newNamedQuery(entityClass, queryName);
        prepareQuery(query);
        return query.executeWithMap(values);
      }
    }, true);
  }

View Full Code Here


        prepareQuery(query);
        query.declareParameters(parameters);
        if (ordering != null) {
          query.setOrdering(ordering);
        }
        return query.executeWithMap(values);
      }
    }, true);
  }

  public Collection find(final String language, final Object queryObject) throws DataAccessException {
View Full Code Here

  public Collection find(final String queryString, final Map values) throws DataAccessException {
    return (Collection) execute(new JdoCallback() {
      public Object doInJdo(PersistenceManager pm) throws JDOException {
        Query query = pm.newQuery(queryString);
        prepareQuery(query);
        return query.executeWithMap(values);
      }
    }, true);
  }

  public Collection findByNamedQuery(final Class entityClass, final String queryName) throws DataAccessException {
View Full Code Here

    return (Collection) execute(new JdoCallback() {
      public Object doInJdo(PersistenceManager pm) throws JDOException {
        Query query = getJdoDialect().newNamedQuery(pm, entityClass, queryName);
        prepareQuery(query);
        return query.executeWithMap(values);
      }
    }, true);
  }

View Full Code Here

    pmControl.setReturnValue(query);
    query.declareParameters("params");
    queryControl.setVoidCallable(1);
    Map values = new HashMap();
    Collection coll = new HashSet();
    query.executeWithMap(values);
    queryControl.setReturnValue(coll);
    pm.close();
    pmControl.setVoidCallable(1);
    pmfControl.replay();
    pmControl.replay();
View Full Code Here

    queryControl.setVoidCallable(1);
    query.setOrdering("c asc");
    queryControl.setVoidCallable(1);
    Map values = new HashMap();
    Collection coll = new HashSet();
    query.executeWithMap(values);
    queryControl.setReturnValue(coll);
    pm.close();
    pmControl.setVoidCallable(1);
    pmfControl.replay();
    pmControl.replay();
View Full Code Here

      String parameterDeclaration = makeParameterDeclarationString(params);
      query.declareParameters(parameterDeclaration);
      query.setOrdering("partitionName ascending");

      List<MPartition> mparts = (List<MPartition>) query.executeWithMap(params);
      // pm.retrieveAll(mparts); // retrieveAll is pessimistic. some fields may not be needed
      List<Partition> results = convertToParts(dbName, tblName, mparts);
      // pm.makeTransientAll(mparts); // makeTransient will prohibit future access of unfetched fields
      query.closeAll();
      success = commitTransaction();
View Full Code Here

      String parameterDeclaration = makeParameterDeclarationStringObj(params);
      query.declareParameters(parameterDeclaration);
      query.setOrdering("partitionName ascending");

      mparts = (List<MPartition>) query.executeWithMap(params);

      LOG.debug("Done executing query for listMPartitionsByFilter");
      pm.retrieveAll(mparts);
      success = commitTransaction();
      LOG.debug("Done retrieving all objects for listMPartitionsByFilter");
View Full Code Here

            " class: " + entry.getValue().getClass().getName());
      }
      String parameterDeclaration = makeParameterDeclarationStringObj(params);
      query.declareParameters(parameterDeclaration);
      query.setFilter(queryFilterString);
      Collection names = (Collection) query.executeWithMap(params);
      //have to emulate "distinct", otherwise tables with the same name may be returned
      Set<String> tableNamesSet = new HashSet<String>();
      for (Iterator i = names.iterator(); i.hasNext();) {
        tableNamesSet.add((String) i.next());
      }
View Full Code Here

      String parameterDeclaration = makeParameterDeclarationStringObj(params);
      query.declareParameters(parameterDeclaration);
      query.setOrdering("partitionName ascending");
      query.setResult("partitionName");

      Collection names = (Collection) query.executeWithMap(params);
      partNames = new ArrayList<String>();
      for (Iterator i = names.iterator(); i.hasNext();) {
        partNames.add((String) i.next());
      }
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.