public Query createQuery(int AD_Tab_ID, QueryVO queryVO, WindowCtx ctx, String tableName) { UITab tab = getTab(AD_Tab_ID); String whereClause = tab.getWhereClause(); if (tab == null) { log.config("Not found AD_Tab_ID=" + AD_Tab_ID); return null; } Query result = tab.createQueryForReport(m_context, queryVO); if (result == null) { result = new Query(tableName); } if (whereClause != null && whereClause.length() != 0) { QueryRestriction restriction = new QueryRestriction(whereClause); result.addRestriction(restriction); } return result; } // executeQuery