同时查询数据库和缓存中的数据
作者:网络转载 发布时间:[ 2016/7/25 11:18:01 ] 推荐标签:数据库 缓存
方法一
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();
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11