Package javax.jdo

Examples of javax.jdo.Query.executeWithMap()


            query.declareParameters("Integer param");
            query.setFilter("x == param");
       
            Map actualParams = new java.util.HashMap();
            actualParams.put("param", new Integer(2) );
            Object results = query.executeWithMap(actualParams);

            // check query result
            List expected = new ArrayList();
            Object p3 = new PCPoint(2, 2);
            expected.add(p3);
View Full Code Here


            query.setFilter("x == param1 && y == param2");
       
            Map actualParams = new java.util.HashMap();
            actualParams.put("param1", new Integer(2) );
            actualParams.put("param2", new Integer(2) );
            Object results = query.executeWithMap(actualParams);

            // check query result
            List expected = new ArrayList();
            Object p3 = new PCPoint(2, 2);
            expected.add(p3);
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

            }

            query.declareParameters( parameters );
            query.setFilter( filter );

            List<BuildResult> result = (List<BuildResult>) query.executeWithMap( params );

            result = (List<BuildResult>) pm.detachCopyAll( result );

            tx.commit();
View Full Code Here

            query.declareParameters("Integer param");
            query.setFilter("x == param");
       
            Map actualParams = new java.util.HashMap();
            actualParams.put("param", new Integer(2) );
            Object results = query.executeWithMap(actualParams);

            // check query result
            List expected = new ArrayList();
            Object p3 = new PCPoint(2, 2);
            expected.add(p3);
View Full Code Here

            query.setFilter("x == param1 && y == param2");
       
            Map actualParams = new java.util.HashMap();
            actualParams.put("param1", new Integer(2) );
            actualParams.put("param2", new Integer(2) );
            Object results = query.executeWithMap(actualParams);

            // check query result
            List expected = new ArrayList();
            Object p3 = new PCPoint(2, 2);
            expected.add(p3);
View Full Code Here

       
        if (LOG.isDebugEnabled()) {
            LOG.debug("query: " + queryName + ", args: " + argumentsByParameterName);
        }
       
        final List<?> results = (List<?>) jdoQuery.executeWithMap(argumentsByParameterName);
        if (cardinality == QueryCardinality.MULTIPLE) {
            return results;
        }
        return results.isEmpty()?Collections.emptyList():results.subList(0, 1);
    }
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.