Examples of declareImports()


Examples of javax.jdo.Query.declareImports()

        if (qmd.getLanguage() == QueryLanguage.JPOXSQL)
        {
            // Apply any imports specified
            if (qmd.hasExtension("imports"))
            {
                query.declareImports(qmd.getValueForExtension("imports"));
            }
            // Apply any parameters specified
            if (qmd.hasExtension("parameters"))
            {
                query.declareParameters(qmd.getValueForExtension("parameters"));
View Full Code Here

Examples of javax.jdo.Query.declareImports()

        expected.add(reader.getFullTimeEmployee("emp2"));
        expected.add(reader.getPartTimeEmployee("emp3"));
           
        // Import Department twice
        query = pm.newQuery(Employee.class);
        query.declareImports("import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Department;");
        query.declareParameters("Department d");
        query.setFilter("department == d");
        result = query.execute(dept1);
        checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d",
                result, expected);
View Full Code Here

Examples of javax.jdo.Query.declareImports()

        checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d",
                result, expected);

        // Import Department explictly and per type-import-on-demand
        query = pm.newQuery(Employee.class);
        query.declareImports("import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.*");
        query.declareParameters("Department d");
        query.setFilter("department == d");
        result = query.execute(dept1);
        checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d",
                result, expected);
View Full Code Here

Examples of javax.jdo.Query.declareImports()

        checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d",
                result, expected);

        // type-import-on-demand twice
        query = pm.newQuery(Employee.class);
        query.declareImports("import org.apache.jdo.tck.pc.company.*; import org.apache.jdo.tck.pc.company.*");
        query.declareParameters("Department d");
        query.setFilter("department == d");
        result = query.execute(dept1);
        checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d",
                result, expected);
View Full Code Here

Examples of javax.jdo.Query.declareImports()

            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.HOUR, -6);
            Query query = pm.newQuery(AuthenticationToken.class);
            query.setFilter("activity < activityParam");
            query.setRange(0, 1000);
            query.declareImports("import java.util.Date");
            query.declareParameters("Date activityParam");
            List<AuthenticationToken> objs = (List<AuthenticationToken>) query.execute(cal.getTime());
              long c = objs.size();
              for (AuthenticationToken obj : objs) {
              pm.deletePersistent(obj);
View Full Code Here

Examples of javax.jdo.Query.declareImports()

          try {
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.HOUR, -6);
            Query query = pm.newQuery(AuthenticationToken.class);
            query.setFilter("activity < activityParam");
            query.declareImports("import java.util.Date");
            query.declareParameters("Date activityParam");
            List<AuthenticationToken> objs = (List<AuthenticationToken>) query.execute(cal.getTime());
            int c = objs.size();
            String msg = user + " - There are " + c + " tokens to flush.";
          log.log(Level.INFO, msg);
View Full Code Here

Examples of javax.jdo.Query.declareImports()

  public static Organisation orgByName(String orgName, Key ignoreKey)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Organisation.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
   
    if (ignoreKey == null)
    {
      query.setFilter("name == nameParam");
      query.declareParameters("String nameParam");
View Full Code Here

Examples of javax.jdo.Query.declareImports()

  public static Collection<Unit> unitsForOrg(Key orgKey, boolean includeUnapproved, boolean cache)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Unit.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
   
    if(includeUnapproved)
      query.setFilter("organisationKey == organisationKeyParam");
    else
      query.setFilter("organisationKey == organisationKeyParam && approved == true");
View Full Code Here

Examples of javax.jdo.Query.declareImports()

  public static Collection<Unit> unitsForVillage(Village village)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Unit.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
   
    query.setFilter("villageKey == villageKeyParam");
    query.declareParameters("Key villageKeyParam");
   
    return queryDetachAndClose(Unit.class, query, false, village.getKeyCheckNotNull());
View Full Code Here

Examples of javax.jdo.Query.declareImports()

  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    // Get the list of village mappings in place for this event
    Query query = pm.newQuery(Unit.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
   
    query.setFilter("villageKey == null");
   
    return queryDetachAndClose(Unit.class, query, false);
  }
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.