Examples of declareVariables()


Examples of javax.jdo.Query.declareVariables()

        query = VALID_QUERIES[index].getAPIQuery(getPM());
        query.declareVariables("Employee e");
        executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false,
                parameters, expectedResult[index], true);
        query = VALID_QUERIES[index].getSingleStringQuery(getPM());
        query.declareVariables("Employee e");
        executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false,
                parameters, expectedResult[index], true);
    }
   
    /**
 
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

            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

Examples of javax.jdo.Query.declareVariables()

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

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

            if ( constraint.getFetchLimits() != null )
            {
                pm.getFetchPlan().addGroup( constraint.getFetchLimits() );
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

  try {
      cp = new CodeParser(clazz);
      q = mgr.newQuery(clazz, cp.getFilter());
      String variables = cp.getVariables();
      if (variables != null) {
    q.declareVariables(variables);
      }
      String parameters = cp.getParameters();
      if (parameters != null) {
    q.declareParameters(parameters);
      }
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

      ((Collection) q.executeWithArray((Object[]) params[i]))
    .iterator().hasNext();
  }

  q = mgr.newQuery(TestInterface.class, "collection.contains(employee) && employee.firstName != \"Bob\"");
  q.declareVariables("Employee employee");
  System.out.println(q);
  ((Collection) q.execute())
      .iterator().hasNext();
 
    }
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

  }
 
  //retrieve a person according to the age of his children
  public static void navigationMultiValuedField(PersistenceManager pm){
    Query query = pm.newQuery(Person.class);
    query.declareVariables("Person child");
    query.setFilter("children.contains(child) & child.age < 5");
    Collection results = (Collection)query.execute();
    System.out.println( "Person(s) having children under-5:");
    Iterator it = results.iterator();
    while(it.hasNext()){
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    outStr.append("\nThe project for the employee ");
    outStr.append(id1).append(" and ").append(id2);

    Query query = pm.newQuery(Project.class);
    query.declareParameters("long id1, long id2");
    query.declareVariables("org.objectweb.speedo.j2eedo.database.Employee e");
    query.setFilter("((members.contains(e)) && ((e.empid==id1) || (e.empid==id2)) )");

    Collection col = (Collection) query.execute(new Long(id1), new Long(id2));
    Iterator iter = col.iterator();
    try {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    public void testNotContains() {
        logger.log(BasicLevel.DEBUG, "testUserCacheSingle");
        PersistenceManager pm = pmf.getPersistenceManager();
        Query q = pm.newQuery(Group.class);
        q.declareParameters("String p1");
        q.declareVariables("User u");
        q.setFilter("!(this.users.contains(u)) && (u.name == p1)");
        Collection c = (Collection) q.execute("user_g0_u0");
        Collection founds = new ArrayList(c.size());
        for (Iterator iter = c.iterator(); iter.hasNext();) {
            Group g = (Group) iter.next();
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

   
    private void notContainsInheritance(String parameter, String[] resultExpected) {
        PersistenceManager pm = pmf.getPersistenceManager();
        Query q = pm.newQuery(NewsGroup.class);
        q.declareParameters("String p1");
        q.declareVariables("GroupUser u");
        q.setFilter("!(this.users.contains(u)) && (u.name == p1)");
        Collection c = (Collection) q.execute(parameter);
        Collection founds = new ArrayList(c.size());
        for (Iterator iter = c.iterator(); iter.hasNext();) {
            NewsGroup ng = (NewsGroup) iter.next();
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    public void testNotContainsComposite() {
        logger.log(BasicLevel.DEBUG, "testNotContainsComposite");
        PersistenceManager pm = pmf.getPersistenceManager();
        Query q = pm.newQuery(MailingList.class);
        q.declareParameters("String p1, String p2");
        q.declareVariables("GroupModerator gm");
        q.setFilter("!(this.moderators.contains(gm)) && (gm.firstName == p1) && (gm.lastName == p2)");
        Collection c = (Collection) q.execute("moderator_ml0", "mod0");
        Collection founds = new ArrayList(c.size());
        for (Iterator iter = c.iterator(); iter.hasNext();) {
            MailingList ml = (MailingList) iter.next();
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.