Examples of executeWithMap()


Examples of javax.jdo.Query.executeWithMap()

      }

        query = pm.newQuery(BitacoraLN.class);
        query.setFilter(queryStr);
    
        detached = (List<BitacoraLN>) pm.detachCopyAll((List<BitacoraLN>) (query.executeWithMap(pars)));
     
      } catch (Exception e) {
        log.error(e.getMessage());         
      } finally {
          pm.close();
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

      Query query = pm.newQuery(BitacoraLN.class);

      query.setFilter(queryBuffer.toString());
      query.setOrdering("fecha DESC");//ASC
      result = (List<BitacoraLN>) pm
          .detachCopyAll((List<BitacoraLN>) (query
              .executeWithMap(pars)));

    } catch (DatastoreTimeoutException e) {
      log.severe(e.getMessage());
      log.severe("datastore timeout at: " + queryString);
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

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

    @SuppressWarnings("unchecked")
    List<MPartition> mparts = (List<MPartition>) query.executeWithMap(params);

    LOG.debug("Done executing query for getPartitionsViaOrmFilter");
    pm.retrieveAll(mparts); // TODO: why is this inconsistent with what we get by names?
    LOG.debug("Done retrieving all objects for getPartitionsViaOrmFilter");
    List<Partition> results = convertToParts(mparts);
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

        getPartQueryWithParams(dbName, tblName, partNames);
    Query query = queryWithParams.getFirst();
    query.setClass(MPartition.class);
    query.setResult("sd");
    @SuppressWarnings("unchecked")
    List<MStorageDescriptor> sds = (List<MStorageDescriptor>)query.executeWithMap(
        queryWithParams.getSecond());
    HashSet<MColumnDescriptor> candidateCds = new HashSet<MColumnDescriptor>();
    for (MStorageDescriptor sd : sds) {
      if (sd != null && sd.getCD() != null) {
        candidateCds.add(sd.getCD());
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

    query.setResultClass(MPartition.class);
    query.setClass(MPartition.class);
    query.setOrdering("partitionName ascending");

    @SuppressWarnings("unchecked")
    List<MPartition> result = (List<MPartition>)query.executeWithMap(queryWithParams.getSecond());
    return result;
  }

  private ObjectPair<Query, Map<String, String>> getPartQueryWithParams(
      String dbName, String tblName, List<String> partNames) {
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

            " 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

Examples of javax.jdo.Query.executeWithMap()

      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

Examples of javax.jdo.Query.executeWithMap()

      Map map = new HashMap();
      map.put("aName", POBuilder.names[1]);
      map.put("anotherName", POBuilder.names[2]);

      Collection col = (Collection) query.executeWithMap(map);
            Iterator iter = col.iterator();
            Collection foundNames = new ArrayList(2);
            Collection expectedNames = map.values();

            Assert.assertTrue("The query result is empty", iter.hasNext());
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

        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

Examples of javax.jdo.Query.executeWithMap()

  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
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.