/** * Pre-build configure the SQL call. */ public void prepareDoesExist(DatabaseField field) { getCall().returnOneRow(); Vector fields = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1); fields.addElement(field); getDatabaseCall().setFields(fields); prepareCall(); }
/** * Allow for the field order to be matched if required. * This is required for custom SQL. */ public void matchFieldOrder(ResultSet resultSet, DatabaseAccessor accessor, AbstractSession session) { if ((getFields() != null) && (!isFieldMatchingRequired())) { return; } setFields(accessor.buildSortedFields(getFields(), resultSet, session)); }
/** * Pre-build configure the SQL call. */ public void prepareSelectOneRow() { if (hasMultipleCalls()) { for (Enumeration callsEnum = getCalls().elements(); callsEnum.hasMoreElements();) { DatabaseCall call = (DatabaseCall)callsEnum.nextElement(); call.returnOneRow(); if (isCallQueryMechanism()) { call.setIsFieldMatchingRequired(true); // Set the fieldsincluding joined and partial fields and compute joined indexes, // this requires and assume that the custom SQL returns the fields in the correct order. call.setFields(((ObjectLevelReadQuery)getQuery()).getSelectionFields()); ((ObjectLevelReadQuery)getQuery()).getJoinedAttributeManager().computeJoiningMappingIndexes(true, getSession(), 0); } } } else { getCall().returnOneRow(); if (isCallQueryMechanism()) { DatabaseCall call = getDatabaseCall(); call.setIsFieldMatchingRequired(true); // Set the fieldsincluding joined and partial fields and compute joined indexes, // this requires and assume that the custom SQL returns the fields in the correct order. call.setFields(((ObjectLevelReadQuery)getQuery()).getSelectionFields()); ((ObjectLevelReadQuery)getQuery()).getJoinedAttributeManager().computeJoiningMappingIndexes(true, getSession(), 0); } } prepareCall(); }
/** * Pre-build configure the SQL call. */ public void prepareSelectAllRows() { if (hasMultipleCalls()) { for (Enumeration callsEnum = getCalls().elements(); callsEnum.hasMoreElements();) { DatabaseCall call = (DatabaseCall)callsEnum.nextElement(); call.returnManyRows(); if (isCallQueryMechanism()) { call.setIsFieldMatchingRequired(true); // Set the fieldsincluding joined and partial fields and compute joined indexes, // this requires and assume that the custom SQL returns the fields in the correct order. call.setFields(((ObjectLevelReadQuery)getQuery()).getSelectionFields()); ((ObjectLevelReadQuery)getQuery()).getJoinedAttributeManager().computeJoiningMappingIndexes(true, getSession(), 0); } } } else { getCall().returnManyRows(); if (isCallQueryMechanism()) { DatabaseCall call = getDatabaseCall(); call.setIsFieldMatchingRequired(true); // Set the fieldsincluding joined and partial fields and compute joined indexes, // this requires and assume that the custom SQL returns the fields in the correct order. call.setFields(((ObjectLevelReadQuery)getQuery()).getSelectionFields()); ((ObjectLevelReadQuery)getQuery()).getJoinedAttributeManager().computeJoiningMappingIndexes(true, getSession(), 0); } } prepareCall(); }