方法一
public class CuxPosAddrTaxRequestVOImpl extends OAViewObjectImpl {
/**This is the default constructor (do not remove)
*/
public CuxPosAddrTaxRequestVOImpl() {
}
public void queryAddTaxRequest(String AddressRequestId)
{
if ((AddressRequestId != null) && (!("".equals(AddressRequestId.trim()))))
{
setMaxFetchSize(-1);
// Do the following conversion for type consistency.
Number nAddressRequestId = null;
try
{
nAddressRequestId = new Number(AddressRequestId);
} catch (Exception e)
{
throw new OAException("PON", "CUX_POS_INVALID_NUMBER");
}
setWhereClause(null);
setWhereClauseParams(null);
addQueryMode(this.QUERY_MODE_SCAN_DATABASE_TABLES |
this.QUERY_MODE_SCAN_ENTITY_ROWS);
ViewCriteria vc = this.createViewCriteria();
ViewCriteriaRow vcr = vc.createViewCriteriaRow();
//设定标准查询参数,可以多个
vcr.setAttribute("AddressRequestId", nAddressRequestId);
vc.addElement(vcr);
vcr.setConjunction(ViewCriteriaRow.VCROW_CONJ_AND);
vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_QUERY |
ViewCriteria.CRITERIA_MODE_CACHE);
this.applyViewCriteria(vc);
//        this.setWhereClause("ADDRESS_REQUEST_ID =" + nAddressRequestId);
executeQuery();
}
}
}
  方法二:待验证
vo.setWhereClause(whereClause);
vo.setWhereClauseParams(null);
vo.setWhereClauseParam(0, entityId);
if(associationConsistent)
vo.setAssociationConsistent(associationConsistent);
vo.executeQuery();
vo.reset();