Package javax.jdo

Examples of javax.jdo.Query.executeWithArray()


    UserSession userSession = null;

    String filters = "id == id_";
    Query query = pm.newQuery(UserSession.class, filters);
    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);
    }
View Full Code Here


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

  public Collection find(Class entityClass, String filter, String parameters, Map values)
View Full Code Here

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

  public Collection find(final String queryString, final Map values) throws DataAccessException {
View Full Code Here

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

  public Collection findByNamedQuery(final Class entityClass, final String queryName, final Map values)
View Full Code Here

    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.executeWithArray("name1", "name3", "bos3", "bos2");
    assertEquals(1, flights.size());
    assertEquals(KeyFactory.keyToString(e3.getKey()), flights.get(0).getId());
  }

  public void testIsNullChild() {
View Full Code Here

      }

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

      }

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

        prepareQuery(query);
        query.declareParameters(parameters);
        if (ordering != null) {
          query.setOrdering(ordering);
        }
        return (Collection<T>) query.executeWithArray(values);
      }
    }, true);
  }

  public <T> Collection<T> find(
View Full Code Here

  public Collection find(final String queryString, final Object... 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.executeWithArray(values);
      }
    }, true);
  }

  public Collection find(final String queryString, final Map<String, ?> values) throws DataAccessException {
View Full Code Here

    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.executeWithArray(values);
      }
    }, true);
  }

  public <T> Collection<T> findByNamedQuery(
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.