|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
InSqlBatchCaller caller = new InSqlBatchCaller(cuserids);
caller.execute(new IInSqlBatchCallBack()
{
public Object doWithInSql(String inSql) throws BusinessException, SQLException
{
String sql = "cuserid in " + inSql;
Collection col = qry.retrieveByClause(UserVO.class, sql, UserMatcher.SUPPORTED_FIELDS);
withinList.addAll(col);
return null;
} } );
示例:
public List<UserVO> matchWithin(String[] cuserids, String matchString) throws BusinessException {
final IUAPQueryBS qry = (IUAPQueryBS)NCLocator.getInstance().lookup(IUAPQueryBS.class);
final List withinList = new ArrayList();
try
{
InSqlBatchCaller caller = new InSqlBatchCaller(cuserids);
caller.execute(new IInSqlBatchCallBack()
{
public Object doWithInSql(String inSql) throws BusinessException, SQLException
{
String sql = "cuserid in " + inSql;
Collection col = qry.retrieveByClause(UserVO.class, sql, UserMatcher.SUPPORTED_FIELDS);
withinList.addAll(col);
return null;
} } );
}
catch (Exception e) {
throw new BusinessException(e);
}
List resultList = new ArrayList();
for (UserVO uvo : withinList) {
for (String field : SUPPORTED_FIELDS) {
if (matches(uvo, field, matchString)) {
resultList.add(uvo);
break;
}
}
}
return resultList;
}
|
|