Package javax.jdo

Examples of javax.jdo.Query.declareVariables()


            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

        }
        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

            query.setFilter( constraint.getFilter() );
        }

        if ( constraint.getVariables() != null )
        {
            query.declareVariables( StringUtils.join( constraint.getVariables(), ";  " ) );
        }

        if ( constraint.getSortColumn() != null )
        {
            String ordering = constraint.getSortColumn();
View Full Code Here

            query.setFilter( constraint.getFilter() );
        }

        if ( constraint.getVariables() != null )
        {
            query.declareVariables( StringUtils.join( constraint.getVariables(), ";  " ) );
        }

        if ( constraint.getSortColumn() != null )
        {
            String ordering = constraint.getSortColumn();
View Full Code Here

            query.declareParameters( "int scheduleId" );

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

            query.declareVariables( "BuildDefinition buildDef" );

            query.setFilter( "buildDefinitions.contains(buildDef) && buildDef.schedule.id == scheduleId" );

            query.setResult( "this.id, buildDef.id" );
View Full Code Here

            query.declareParameters( "int scheduleId" );

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

            query.declareVariables( "BuildDefinition buildDef" );

            query.setFilter( "buildDefinitions.contains(buildDef) && buildDef.schedule.id == scheduleId" );

            query.setResult( "this.id, buildDef.id" );
View Full Code Here

            query.declareParameters( "int projectId" );

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

            query.declareVariables( "Project project" );

            query.setResult( "this" );

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

            query.setFilter( constraint.getFilter() );
        }

        if ( constraint.getVariables() != null )
        {
            query.declareVariables( StringUtils.join( constraint.getVariables(), ";  " ) );
        }

        if ( constraint.getSortColumn() != null )
        {
            String ordering = constraint.getSortColumn();
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.