// create a map of the overrides based on flat property name
HashMap overrides = new HashMap();
for (int i = 0; i < cmpField.getPropertyOverrides().size(); ++i) {
JDBCCMPFieldPropertyMetaData p = (JDBCCMPFieldPropertyMetaData) cmpField.getPropertyOverrides().get(i);
overrides.put(p.getPropertyName(), p);
}
// array that will hold the final properites after overrides
JDBCTypeComplexProperty[] finalProperties = new JDBCTypeComplexProperty[defaultProperties.length];
// override property default values
for (int i = 0; i < defaultProperties.length; i++) {
// pop off the override, if present
JDBCCMPFieldPropertyMetaData override;
override = (JDBCCMPFieldPropertyMetaData) overrides.remove(defaultProperties[i].getPropertyName());
if (override == null) {
finalProperties[i] = defaultProperties[i];
finalProperties[i] = new JDBCTypeComplexProperty(
defaultProperties[i],
cmpField.getColumnName() + "_" +
defaultProperties[i].getColumnName(),
defaultProperties[i].getJDBCType(),
defaultProperties[i].getSQLType(),
cmpField.isNotNull() || defaultProperties[i].isNotNull());
} else {
// columnName
String columnName = override.getColumnName();
if (columnName == null) {
columnName = cmpField.getColumnName() + "_" + defaultProperties[i].getColumnName();
}
// sql and jdbc type
String sqlType = override.getSQLType();
int jdbcType;
if (sqlType != null) {
jdbcType = override.getJDBCType();
} else {
sqlType = defaultProperties[i].getSQLType();
jdbcType = defaultProperties[i].getJDBCType();
}
boolean notNull = cmpField.isNotNull() ||
override.isNotNull() ||
defaultProperties[i].isNotNull();
finalProperties[i] = new JDBCTypeComplexProperty(
defaultProperties[i],
columnName,