Package javax.jdo

Examples of javax.jdo.Query.addExtension()


        final String pkOtoaId = pkOtoa.getId();
        final String filter = pkOtoaId + "==" + map.get(pkOtoaId);
        final Query jdoQuery = getPersistenceManager().newQuery(cls, filter);

        // http://www.datanucleus.org/servlet/jira/browse/NUCCORE-1103
        jdoQuery.addExtension("datanucleus.multivaluedFetch", "none");
       
        if (LOG.isDebugEnabled()) {
            LOG.debug(cls.getName() + " # " + queryName + " ( " + filter + " )");
        }
       
View Full Code Here


        final PersistenceManager persistenceManager = getJdoObjectStore().getPersistenceManager();
        final Class<?> cls = objectSpec.getCorrespondingClass();
        final Query jdoQuery = persistenceManager.newNamedQuery(cls, queryName);
       
        // http://www.datanucleus.org/servlet/jira/browse/NUCCORE-1103
        jdoQuery.addExtension("datanucleus.multivaluedFetch", "none");
       
        if(persistenceQuery.hasRange()) {
            jdoQuery.setRange(persistenceQuery.getStart(), persistenceQuery.getEnd());
        }
       
View Full Code Here

        }

        final Query jdoQuery = persistenceManager.newQuery(queryString);
       
        // http://www.datanucleus.org/servlet/jira/browse/NUCCORE-1103
        jdoQuery.addExtension("datanucleus.multivaluedFetch", "none");

        return jdoQuery;
    }

    private static StringBuilder appendSelect(
View Full Code Here

       
        Class<?> cls = specification.getCorrespondingClass();
        final Query jdoQuery = getPersistenceManager().newQuery(cls);
       
        // http://www.datanucleus.org/servlet/jira/browse/NUCCORE-1103
        jdoQuery.addExtension("datanucleus.multivaluedFetch", "none");
       
        if (LOG.isDebugEnabled()) {
            LOG.debug("allInstances(): class=" + specification.getFullIdentifier());
        }
       
View Full Code Here

        {
            for (int i=0;i<extmds.length;i++)
            {
                if (extmds[i].getVendorName().equals(MetaData.VENDOR_NAME))
                {
                    query.addExtension(extmds[i].getKey(), extmds[i].getValue());
                }
            }
        }
        if (qmd.isUnmodifiable())
        {
View Full Code Here

    }
  }

  private void assertCursorResults(Cursor cursor, List<Key> expectedKeys) {
    Query q = pm.newQuery("select from " + Book.class.getName());
    q.addExtension(JDOCursorHelper.QUERY_CURSOR_PROPERTY_NAME, cursor);
    List<Key> keys = Utils.newArrayList();
    for (Object b : (Iterable) q.execute()) {
      keys.add(KeyFactory.stringToKey(((Book) b).getId()));
    }
    assertEquals(expectedKeys, keys);
View Full Code Here

    Query q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses > c && c.department == 'Biology' && "
        + "grade == 10");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
        if (jdoe.getCause() instanceof DatastoreQuery.UnsupportedDatastoreFeatureException) {
View Full Code Here

    q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade > 10");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
        if (jdoe.getCause() instanceof DatastoreQuery.UnsupportedDatastoreFeatureException) {
View Full Code Here

    q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department > 'Biology' && "
        + "grade == 10");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
        if (jdoe.getCause() instanceof DatastoreQuery.UnsupportedDatastoreFeatureException) {
View Full Code Here

    q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10 order by grade");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
        if (jdoe.getCause() instanceof DatastoreQuery.UnsupportedDatastoreFeatureException) {
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.