Package com.mysql.clusterj.query

Examples of com.mysql.clusterj.query.PredicateOperand.between()


        // parameter name
        PredicateOperand upper = dobj.param("upper");
        // property name
        PredicateOperand column = dobj.get("eid");
        // 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);
View Full Code Here


        // property
        PredicateOperand propertyMagic = dobj.get("magic");
        PredicateOperand propertyId = dobj.get("id");
        // where
        // param1 is used in two different places but same type (int) in both
        dobj.where(propertyMagic.equal(param1).and(propertyId.between(param1, param2)));
        Query<Employee> query = session.createQuery(dobj);
        query.setParameter("param1", 4);
        query.setParameter("param2", 5);
        List<Employee> result = query.getResultList();
        errorIfNotEqual("Wrong size of result", 1, result.size());
View Full Code Here

            // property
            PredicateOperand propertyAge = dobj.get("magic");
            PredicateOperand propertyMagic = dobj.get("name");
            // where
            // expect an exception here because param1 is used for String name and int magic
            dobj.where(propertyAge.equal(param1).and(propertyMagic.between(param1, param2)));
        } catch (ClusterJUserException e) {
            // good catch
        }
    }
View Full Code Here

        // parameter name
        PredicateOperand upper = dobj.param("upper");
        // property name
        PredicateOperand column = dobj.get("id");
        // 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);
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.