Examples of executeWithMap()


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

Examples of javax.jdo.Query.executeWithMap()

    // Same but using executeWithMap
    Query q2 = pm.newQuery("select from " + Flight.class.getName() + " where :p1.contains(name)");
    Map params = new HashMap();
    params.put("p1", Arrays.asList("name1", "name3"));
    List<Flight> flights2 = (List<Flight>) q2.executeWithMap(params);
    assertEquals(2, flights2.size());
    assertEquals(KeyFactory.keyToString(e.getKey()), flights2.get(0).getId());
    assertEquals(KeyFactory.keyToString(e3.getKey()), flights2.get(1).getId());

    q = pm.newQuery("select from " + Flight.class.getName() + " where :p1.contains(dest)");
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

    Map<String, String> paramMap = Utils.newHashMap();
    paramMap.put("p1", "name1");
    paramMap.put("p2", "name3");
    paramMap.put("p3", "bos3");
    paramMap.put("p4", "bos2");
    List<Flight> flights = (List<Flight>) q.executeWithMap(paramMap);
    assertEquals(1, flights.size());
    assertEquals(KeyFactory.keyToString(e3.getKey()), flights.get(0).getId());
  }

  public void testExecuteWithArray() {
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

    try {
      Query q = pm.newQuery(Flight.class);
      q.setDatastoreReadTimeoutMillis(3000);
      try {
        ((List<?>) q.executeWithMap(new HashMap())).isEmpty();
        fail("expected exception");
      } catch (JDODataStoreException e) { // TODO Catch nested as QueryTimeoutException
        // good
      }
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

     
      query.declareParameters(paramDec.toString());

      query.setRange(0, limit);
      List<VideoSubmission> results;
      results = (List<VideoSubmission>) query.executeWithMap(params);
      for (VideoSubmission submission : results) {
        submissions.add(submission);
      }

    } finally {
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

        prepareQuery(query);
        query.declareParameters(parameters);
        if (ordering != null) {
          query.setOrdering(ordering);
        }
        return (Collection<T>) 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<String, ?> values) throws DataAccessException {
    return execute(new JdoCallback<Collection>() {
      public Collection doInJdo(PersistenceManager pm) throws JDOException {
        Query query = pm.newQuery(queryString);
        prepareQuery(query);
        return (Collection) query.executeWithMap(values);
      }
    }, true);
  }

  public <T> Collection<T> findByNamedQuery(final Class<T> entityClass, final String queryName)
View Full Code Here

Examples of javax.jdo.Query.executeWithMap()

    return execute(new JdoCallback<Collection<T>>() {
      @SuppressWarnings("unchecked")
      public Collection<T> doInJdo(PersistenceManager pm) throws JDOException {
        Query query = pm.newNamedQuery(entityClass, queryName);
        prepareQuery(query);
        return (Collection<T>) query.executeWithMap(values);
      }
    }, true);
  }

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.