如何使用queryspec过滤掉已禁用和已修复的用户
public void searchUser() throws WTException {
QuerySpec qs = new QuerySpec(WTUser.class);
String name = "ns";
qs.appendWhere(new SearchCondition(WTUser.class, WTUser.NAME, SearchCondition.LIKE, "%" + name + "%"), new int[]{0});
qs.appendAnd();
qs.appendWhere(new SearchCondition(WTUser.class, WTUser.DISABLED, SearchCondition.IS_FALSE), new int[] { 0 });
qs.appendAnd();
qs.appendWhere(new SearchCondition(WTUser.class, WTUser.REPAIR_NEEDED, SearchCondition.IS_FALSE), new int[]{0});
qs.appendAnd();
qs.appendWhere(new SearchCondition(WTUser.class, WTUser.INTERNAL, SearchCondition.IS_FALSE), new int[]{0});
QueryResult qr = PersistenceHelper.manager.find(qs);
while(qr.hasMoreElements())
{
WTUser user = (WTUser)qr.nextElement();
}
}