Package javax.jdo

Examples of javax.jdo.Query.declareVariables()


            query.declareImports( "import org.apache.maven.continuum.model.project.BuildDefinition" );

            query.setFilter( "this.buildDefinitions.contains(buildDef) && buildDef.defaultForProject == true" );

            query.declareVariables( "BuildDefinition buildDef" );

            query.setResult( "this.id, buildDef.id" );

            List result = (List) query.execute();
View Full Code Here


            query.declareParameters( "int projectGroupId" );

            query.setFilter(
                "this.id == projectGroupId && this.buildDefinitions.contains(buildDef) && buildDef.defaultForProject == true" );

            query.declareVariables( "BuildDefinition buildDef" );

            query.setResult( "buildDef" );

            List<BuildDefinition> result = (List<BuildDefinition>) query.execute( projectGroupId );
View Full Code Here

            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

            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

            tx.begin();

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

            // Just check whether query compiles
View Full Code Here

            tx.begin();

            Query query = pm.newQuery();
            query.setClass(Department.class);
            query.setCandidates(pm.getExtent(Department.class, false));
            query.declareVariables("org.apache.jdo.tck.pc.company.Employee e; org.apache.jdo.tck.pc.company.Project p;");
            query.setFilter("employees.contains(e) && (e.projects.contains(p) && p.projid == 1)");
            Object results = query.execute();

            // Just check whether query compiles
View Full Code Here

        query.setUnique(false);
        query.setResult(null);
        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);
View Full Code Here

        }
        if (this.filter != null) {
            query.setFilter(this.filter);
        }
        if (this.variables != null) {
            query.declareVariables(this.variables);
        }
        if (this.parameters != null) {
            query.declareParameters(this.parameters);
        }
        if (this.imports != null ) {
View Full Code Here

            tx.begin();
            Query query = pm.newQuery();
            query.setClass(clazz);
            query.setCandidates(pm.getExtent(clazz, false));
            try {
                query.declareVariables( "org.apache.jdo.tck.pc.company.Person reviewers;" );
                query.setFilter( "reviewers.contains(reviewers)" );
                Object results = query.execute();
                fail(ASSERTION_FAILED,
                     "Variable declaration \"Person reviewers\" did not hide field Person.reviewers");
            }
View Full Code Here

        try {
            tx.begin();
            Query query = pm.newQuery();
            query.setClass(clazz);
            query.setCandidates(pm.getExtent(clazz, false));
            query.declareVariables( "org.apache.jdo.tck.pc.company.Person reviewers;" );
            query.setFilter( "this.reviewers.contains(reviewers) && reviewers.firstname==\"brazil\"" );
            Object results = query.execute();
        }
        finally {
            if (tx.isActive())
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.