public static ModTest getComplexModTest() { ModTest test = getSimpleModTest(); test.setName("Complex " + test.getName()); test.setEjbqlString(test.getEjbqlString() + " AND emp.firstName <> \"XCV\""); return test; }
private static ModTest getNewTestCaseNamed(String name, String ejbql, Class referenceClass) { ModTest test = new ModTest(); test.setName(name); test.setEjbqlString(ejbql); test.setReferenceClass(referenceClass); return test; }
public static ModTest getSimpleModTest() { String ejbql = "SELECT OBJECT(emp) FROM Employee emp WHERE MOD(emp.salary, 2) > 0"; ModTest test = getNewTestCaseNamed("Mod Test", ejbql, Employee.class); ExpressionBuilder employee = new ExpressionBuilder(); Expression whereClause = ExpressionMath.mod(employee.get("salary"), 2).greaterThan(0); test.setOriginalObjectExpression(whereClause); return test; }