Package com.mysql.clusterj

Examples of com.mysql.clusterj.Query


        // compare the column with the parameter
        Predicate compare = column.equal(param);
        // set the where clause into the query
        dobj.where(compare);
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter value
        query.setParameter("eid", (long)8);
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)8);
        Set<Long> actual = new HashSet<Long>();
View Full Code Here


        // compare the column with the parameter
        Predicate compare = column.greaterThan(param);
        // set the where clause into the query
        dobj.where(compare);
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("eid", (long)6);
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)7);
View Full Code Here

        // compare the column with the parameter
        Predicate compare = column.greaterEqual(param);
        // set the where clause into the query
        dobj.where(compare);
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("eid", (long)7);
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)7);
View Full Code Here

        // compare the column with the parameter
        Predicate compare = column.lessThan(param);
        // set the where clause into the query
        dobj.where(compare);
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("eid", (long)3);
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)0);
View Full Code Here

        // compare the column with the parameter
        Predicate compare = column.lessEqual(param);
        // set the where clause into the query
        dobj.where(compare);
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("eid", (long)2);
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)0);
View Full Code Here

        // compare the column with the parameter
        Predicate compare = column.between(lower, upper);
        // set the where clause into the query
        dobj.where(compare);
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("lower", (long)5);
        query.setParameter("upper", (long)7);
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)5);
View Full Code Here

        tx = session.currentTransaction();
        tx.begin();
        QueryBuilder builder = session.getQueryBuilder();
        QueryDomainType dobj = builder.createQueryDefinition(NotPersistentTypes.class);
        dobj.where(dobj.get("id").equal(dobj.param("id")));
        Query query = session.createQuery(dobj);
        query.setParameter("id", 0);
        List<NotPersistentTypes> result = query.getResultList();
        int resultSize = result.size();
        errorIfNotEqual("Wrong query result size", 1, resultSize);
        NotPersistentTypes npt = result.get(0);
        int resultId = npt.getId();
        tx.commit();
View Full Code Here

        tx.begin();
        setupQuery();
        // compare the column with the parameter
        dobj.where(equalA0.and(equalA1.and(equalA2.and(equalA3))));
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("a0", "dc=com");
        query.setParameter("a1", getA1for(NUMBER_OF_INSTANCES, 8));
        query.setParameter("a2", "ou=people");
        query.setParameter("a3", getA3for(8));
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)8);
View Full Code Here

        setupQuery();
        // compare the column with the parameter
        dobj.where(equalA0.and(equalA1.and(equalA2.and(
                lessEqualA3.and(greaterEqualA3)))));
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("a0", "dc=com");
        query.setParameter("a1", getA1for(NUMBER_OF_INSTANCES, 8));
        query.setParameter("a2", "ou=people");
        query.setParameter("a3Upper", getA3for(9));
        query.setParameter("a3Lower", getA3for(8));
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)8);
View Full Code Here

        setupQuery();
        // compare the column with the parameter
        dobj.where(equalA0.and(equalA1.and(equalA2.and(
                lessA3.and(greaterEqualA3)))));
        // create a query instance
        Query query = session.createQuery(dobj);

        // set the parameter values
        query.setParameter("a0", "dc=com");
        query.setParameter("a1", getA1for(NUMBER_OF_INSTANCES, 8));
        query.setParameter("a2", "ou=people");
        query.setParameter("a3Lower", getA3for(8));
        query.setParameter("a3Upper", getA3for(9));
        // get the results
        List<Dn2id> results = query.getResultList();
        // consistency check the results
        consistencyCheck(results);
        // verify we got the right instances
        Set<Long> expected = new HashSet<Long>();
        expected.add((long)8);
View Full Code Here

TOP

Related Classes of com.mysql.clusterj.Query

Copyright © 2018 www.massapicom. 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.