/** * @param queryResultObjectDataMap * @param query */ public void setDependentIdentifiedColumnIds(Map queryResultObjectDataMap, Query query) { Iterator keyIterator; QueryResultObjectData queryResultObjectData2; QueryResultObjectData queryResultObjectData3; Vector queryObjects; Set keySet2 = queryResultObjectDataMap.keySet(); keyIterator = keySet2.iterator(); for (int i = 0; keyIterator.hasNext(); i++) { queryResultObjectData2 = (QueryResultObjectData) queryResultObjectDataMap.get(keyIterator.next()); queryObjects = queryResultObjectData2.getIndependentQueryObjects(); for (int j = 0; j < queryObjects.size(); j++) { queryResultObjectData3 = (QueryResultObjectData) queryObjects.get(j); queryResultObjectData3.setDependentColumnIds( query.getColumnIds( queryResultObjectData3.getAliasName(), queryResultObjectData3.getDependentObjectAliases())); queryResultObjectData3.setIdentifiedDataColumnIds( query.getIdentifiedColumnIds( queryResultObjectData3.getAliasName(), queryResultObjectData3.getDependentObjectAliases())); Logger.out.debug( " table:" + queryResultObjectData3.getAliasName() + " columnIds:" + queryResultObjectData3.getDependentColumnIds()); } } }
/** * @param queryResultObjectDataMap * @param query */ public List addObjectIdentifierColumnsToQuery(Map queryResultObjectDataMap, Query query) { DataElement identifierDataElement; List columnNames = new ArrayList(); Set keySet = queryResultObjectDataMap.keySet(); Iterator keyIterator = keySet.iterator(); QueryResultObjectData queryResultObjectData2; QueryResultObjectData queryResultObjectData3; Vector queryObjects; Vector queryObjectNames; int initialColumnNumbers = query.getResultView().size(); Map columnIdsMap; for (int i = 0; keyIterator.hasNext(); i++) { queryResultObjectData2 = (QueryResultObjectData) queryResultObjectDataMap.get(keyIterator.next()); queryObjects = queryResultObjectData2.getIndependentQueryObjects(); queryObjectNames = queryResultObjectData2.getIndependentObjectAliases(); for (int j = 0; j < queryObjects.size(); j++) { columnIdsMap = query.getIdentifierColumnIds(queryObjectNames); queryResultObjectData3 = (QueryResultObjectData) queryObjects.get(j); queryResultObjectData3.setIdentifierColumnId( ((Integer) columnIdsMap.get(queryResultObjectData3.getAliasName())).intValue() - 1); } } int columnsAdded = query.getResultView().size() - initialColumnNumbers; for (int i = 0; i < columnsAdded; i++) { columnNames.add(" ID"); } return columnNames; }
/** * @param fromTables * @param queryResultObjectDataMap * @param query */ public void createQueryResultObjectData(Set fromTables, Map queryResultObjectDataMap, Query query) throws DAOException { Iterator iterator = fromTables.iterator(); String tableAlias; QueryResultObjectData queryResultObjectData; Vector mainQueryObjects = QueryBizLogic.getMainObjectsOfQuery(); Logger.out.debug(" tables in query:" + fromTables); while (iterator.hasNext()) { tableAlias = (String) iterator.next(); Logger.out.debug("*********** table obtained from fromTables set:" + tableAlias); if (mainQueryObjects.contains(tableAlias)) { queryResultObjectData = createQueryResultObjectData(tableAlias, fromTables); if (query.getColumnIds(tableAlias, queryResultObjectData.getDependentObjectAliases()).size() != 0) { queryResultObjectDataMap.put(tableAlias, queryResultObjectData); } } } }