/** * PUBLIC: * Checks if a key (ie. the field) is contained in the database row. * Conforms to a hashtable interface. * @param key an Object, either String or DatabaseField * @return boolean - true if the row with the corresponding key is in the row. */ public boolean containsKey(Object key) { return super.containsKey(key); }
/** * PUBLIC: * Checks if a given field is contained in the database row. * @param key String, the DatabaseField name * @return boolean - true if the row contains the key with the corresponding fieldName. */ public boolean containsKey(String fieldName) { return super.containsKey(fieldName); }
/** * PUBLIC: * Check if the field is contained in the row. * Conform to hashtable interface. */ public boolean containsKey(Object key) { if (key instanceof String) { return containsKey((String)key); } if (key instanceof DatabaseField) { return containsKey((DatabaseField)key); } return false; }
/** * PUBLIC: * Check if the field is contained in the row. */ public boolean containsKey(String fieldName) { // Optimized the field creation. if (this.lookupField == null) { this.lookupField = new DatabaseField(fieldName); } else { this.lookupField.resetQualifiedName(fieldName); } return containsKey(this.lookupField); }
/** * INTERNAL: * The translation row may require additional fields than the primary key if the mapping in not on the primary key. */ protected void prepareTranslationRow(AbstractRecord translationRow, Object object, AbstractSession session) { // Make sure that each source key field is in the translation row. for (Enumeration sourceFieldsEnum = getSourceKeyFields().elements(); sourceFieldsEnum.hasMoreElements();) { DatabaseField sourceKey = (DatabaseField)sourceFieldsEnum.nextElement(); if (!translationRow.containsKey(sourceKey)) { Object value = getDescriptor().getObjectBuilder().extractValueFromObjectForField(object, sourceKey, session); translationRow.put(sourceKey, value); } } }
/** * INTERNAL: * The translation row may require additional fields than the primary key if the mapping in not on the primary key. */ protected void prepareTranslationRow(AbstractRecord translationRow, Object object, AbstractSession session) { // Make sure that each source key field is in the translation row. for (Enumeration sourceFieldsEnum = getSourceKeyFields().elements(); sourceFieldsEnum.hasMoreElements();) { DatabaseField sourceKey = (DatabaseField)sourceFieldsEnum.nextElement(); if (!translationRow.containsKey(sourceKey)) { Object value = getDescriptor().getObjectBuilder().extractValueFromObjectForField(object, sourceKey, session); translationRow.put(sourceKey, value); } } }
/** * INTERNAL: * get reference object keys */ public Vector getReferenceObjectKeys(ObjectLevelModifyQuery query) throws DatabaseException, OptimisticLockException { Vector referenceObjectKeys = new Vector(getSourceKeyFields().size()); //For CR#2587-S.M. For nested aggregate collections the source keys can easily be read from the original query. AbstractRecord translationRow = query.getTranslationRow(); for (Enumeration sourcekeys = getSourceKeyFields().elements(); sourcekeys.hasMoreElements();) { DatabaseField sourceKey = (DatabaseField)sourcekeys.nextElement(); // CR#2587. Try first to get the source key from the original query. If that fails try to get it from the object. Object referenceKey = null; if ((translationRow != null) && (translationRow.containsKey(sourceKey))) { referenceKey = translationRow.get(sourceKey); } else { referenceKey = getDescriptor().getObjectBuilder().extractValueFromObjectForField(query.getObject(), sourceKey, query.getSession()); } referenceObjectKeys.addElement(referenceKey); } return referenceObjectKeys; }
if ((primaryValue == null) && (!databaseRow.containsKey(primaryKeyField))) { if (object != null) { DatabaseMapping mapping = getMappingForField(secondaryKeyField);
if (row.containsKey(field)) { getObjectBuilder(aggregate, query.getSession()).assignReturnValueForField(aggregate, query, row, field, handledMappings); for (int i = 0; (i < getReferenceFields().size()) && allAttributesNull; i++) { DatabaseField field = (DatabaseField)fields.elementAt(i); if (row.containsKey(field)) { allAttributesNull = row.get(field) == null; } else {
for (Iterator iterator = returnFields.iterator(); iterator.hasNext();) { DatabaseField field = (DatabaseField)iterator.next(); if (outputRow.containsKey(field)) { row.put(field, outputRow.get(field)); for (int i = 0; i < primaryKeyFields.size(); i++) { DatabaseField field = (DatabaseField)primaryKeyFields.get(i); if (row.containsKey(field)) { pkToModify.put(field, row.get(field));