18 package testsuite.clusterj;
20 import java.util.List;
22 import testsuite.clusterj.model.Employee;
24 import com.mysql.clusterj.ClusterJUserException;
25 import com.mysql.clusterj.Query;
27 import com.mysql.clusterj.query.PredicateOperand;
28 import com.mysql.clusterj.query.QueryBuilder;
29 import com.mysql.clusterj.query.QueryDomainType;
59 void createInstances(
int number) {
60 createEmployeeInstances(10);
70 PredicateOperand param1 = dobj.param(
"param1");
71 PredicateOperand param2 = dobj.param(
"param2");
73 PredicateOperand propertyMagic = dobj.get(
"magic");
74 PredicateOperand propertyId = dobj.get(
"id");
77 dobj.where(propertyMagic.equal(param1).and(propertyId.between(param1, param2)));
79 query.setParameter(
"param1", 4);
80 query.setParameter(
"param2", 5);
82 errorIfNotEqual(
"Wrong size of result", 1, result.size());
83 if (result.size() == 1) {
84 errorIfNotEqual(
"Wrong result", 4, result.get(0).getId());
89 public void testNegative() {
96 PredicateOperand param1 = dobj.param(
"param1");
97 PredicateOperand param2 = dobj.param(
"param2");
99 PredicateOperand propertyAge = dobj.get(
"magic");
100 PredicateOperand propertyMagic = dobj.get(
"name");
103 dobj.where(propertyAge.equal(param1).and(propertyMagic.between(param1, param2)));
104 }
catch (ClusterJUserException e) {