Examples of declareImports()


Examples of javax.jdo.Query.declareImports()

            Extent extent = pm.getExtent( BuildDefinition.class, true );

            Query query = pm.newQuery( extent );

            query.declareImports( "import " + Project.class.getName() );

            query.declareParameters( "int projectId" );

            query.setFilter(
                "project.id == projectId && project.buildDefinitions.contains(this) && this.defaultForProject == true" );
View Full Code Here

Examples of javax.jdo.Query.declareImports()

            tx.begin();

            Query query = pm.newQuery( "SELECT FROM " + BuildResult.class.getName() +
                " WHERE project.id == projectId PARAMETERS int projectId ORDER BY endTime DESC" );

            query.declareImports( "import java.lang.Integer" );

            query.declareParameters( "Integer projectId" );

            List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
View Full Code Here

Examples of javax.jdo.Query.declareImports()

      LOG.debug("Executing listTableNamesByFilter");
      dbName = dbName.toLowerCase().trim();
      Map<String, Object> params = new HashMap<String, Object>();
      String queryFilterString = makeTableQueryFilterString(filter, params);
      Query query = pm.newQuery(MTable.class);
      query.declareImports("import java.lang.String");
      query.setResult("tableName");
      query.setResultClass(java.lang.String.class);
      if (maxTables >= 0) {
        query.setRange(0, maxTables);
      }
View Full Code Here

Examples of javax.jdo.Query.declareImports()

        }
        if (this.parameters != null) {
            query.declareParameters(this.parameters);
        }
        if (this.imports != null ) {
            query.declareImports(this.imports);
        }
        if (this.grouping != null) {
            query.setGrouping(this.grouping);
        }
        if (this.ordering != null) {
View Full Code Here

Examples of javax.jdo.Query.declareImports()

            tx.begin();

            Query query = pm.newQuery();
            query.setClass(PCPoint.class);
            query.setCandidates(pm.getExtent(PCPoint.class, false));
            query.declareImports("import java.lang.Integer");
            query.declareParameters("Integer param");
            query.setFilter("y == param");
            Object results = query.execute(new Integer(2));

            // check query result
View Full Code Here

Examples of javax.jdo.Query.declareImports()

            tx.begin();

            Query query = pm.newQuery();
            query.setClass(Department.class);
            query.setCandidates(pm.getExtent(Department.class, false));
            query.declareImports("import org.apache.jdo.tck.pc.company.Employee");
            query.declareVariables("Employee e" );
            query.setFilter("employees.contains(e) && e.firstname==\"Michael\"" );
            Object results = query.execute();

            // Just check whether query with import declaration compiles
View Full Code Here

Examples of javax.jdo.Query.declareImports()

            tx.begin();

            Query query = pm.newQuery();
            query.setClass(Company.class);
            query.setCandidates(pm.getExtent(Company.class, false));
            query.declareImports("import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Department");
            query.declareVariables("Department d; Employee e" );
            query.setFilter("departments.contains(d) && (d.employees.contains(e) && e.firstname==\"Michael\")");
            Object results = query.execute();

            // Just check whether query with import declarations compiles
View Full Code Here

Examples of javax.jdo.Query.declareImports()

        query.setResultClass(null);
        query.setClass(FullTimeEmployee.class);
        query.setFilter(null);
        query.declareVariables(null);
        query.declareParameters(null);
        query.declareImports(null);
        query.setGrouping(null);
        query.setOrdering(null);
        query.setRange(null);
        executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null,
                expectedResult[index], true);
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, result, expected);
View Full Code Here

Examples of javax.jdo.Query.declareImports()

        result = query.execute(dept1);
        checkQueryResultWithoutOrder(ASSERTION_FAILED, 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, result, expected);

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.