* @See BasicCollectionAccessor and BasicMapAccessor.
*/
protected DatabaseField getDatabaseField(DatabaseTable defaultTable, String loggingCtx) {
// Check if we have an attribute override first, otherwise process for
// a column (ignoring if for a key column on a basic map)
ColumnMetadata column;
if (getDescriptor().hasAttributeOverrideFor(getAttributeName()) && ! loggingCtx.equals(MetadataLogger.MAP_KEY_COLUMN)) {
column = getDescriptor().getAttributeOverrideFor(getAttributeName()).getColumn();
} else {
column = getColumn(loggingCtx);
}
// Get the actual database field and apply any defaults.
DatabaseField field = column.getDatabaseField();
// Make sure there is a table name on the field.
if (field.getTableName().equals("")) {
field.setTable(defaultTable);
}
// Set the correct field name, defaulting and logging when necessary.
String defaultName = column.getUpperCaseAttributeName();
// If this is for a map key column, append a suffix.
if (loggingCtx.equals(MetadataLogger.MAP_KEY_COLUMN)) {
defaultName += DEFAULT_MAP_KEY_COLUMN_SUFFIX;
}