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);