关于ofbiz的一个问题

sillyman
03-09-25 2 216

select * from table where field1>field2 怎么实现啊

我用如下代码,不行,不知道为什么
GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
List exprlist = new ArrayList();

EntityExpr expr = new EntityExpr("field1",EntityOperator.LESS_THAN ,"field2");

exprlist.add(expr);

try {
list = delegator.findByCondition("table",
exprlist,
selectList);
} catch (GenericEntityException e) {
e.printStackTrace();
}

wys1978
2003-09-25 18:42

try the EntityWhereString:

EntityCondition ec = new EntityWhereString ("field1 > field2");
exprlist.add(ec);

sillyman
2003-09-26 10:14

强,谢了!