重写getQueryExecutor方法
/**
* 获取Query执行接口。
*/
protected IQueryExecutor getQueryExecutor(IMetaDataPK queryPK, EntityViewInfo viewInfo)
{
IQueryExecutor exec = null;
if (getMainOrgContext() != null && FrameWorkUtils.getCurrentOrgUnit(getMainOrgContext()) != null)
{
exec = QueryExecutorFactory.getRemoteInstanceWithObjectContext(queryPK, getMainOrgContext());
exec.setObjectView(viewInfo);
}
else
{
exec = super.getQueryExecutor(queryPK, viewInfo);
}
boolean b=true;
if (mainQuery!=null&&mainQuery.getSorter() != null && mainQuery.getSorter().size() > 0)
{
this.setIsIgnoreOrder(true);
}
else
{
this.setIsIgnoreOrder(false);
b=false;
}
exec.option().isIgnoreOrder =b;
exec.option().isAutoIgnoreZero = false;
exec.option().isAutoTranslateBoolean = true;
exec.option().isAutoTranslateEnum = true;
exec.option().topCount = getMaxReturnRowCount();
exec.option().pageCount=KDTDataRequestManager.defaultPageRow;
if (UIConfigUtility.getCofigValue("QueryTransactionType","isReadUnCommited","false").equalsIgnoreCase("true"))
exec.option().transactionIsolation=java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
if (this.getUIContext() != null && this.getUIContext().get("IGNORE_DATAPERMISSION_CHECK") != null)
{
try
{
if (Boolean.TRUE.equals(this.getUIContext().get("IGNORE_DATAPERMISSION_CHECK")))
{
exec.option().isIgnorePermissionCheck = true;
}
}
catch (ClassCastException e)
{
logger.error("get IGNORE_DATAPERMISSION_CHECK error", e);
}
}
return exec;
}