Iterator it = attributeOverrides.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
ObjAttribute attribute = (ObjAttribute) entry.getKey();
Entity entity = attribute.getEntity();
String key = null;
int jdbcType = TypesMapping.NOT_DEFINED;
int index = -1;
for (int i = 0; i < columns.length; i++) {
if (columns[i] == entry.getValue()) {
// if attribute type is the same as column, there is no conflict
if (!attribute.getType().equals(columns[i].getJavaClass())) {
// note that JDBC index is "1" based
index = i + 1;
jdbcType = columns[i].getJdbcType();
key = columns[i].getDataRowKey();
}
break;
}
}
if (index < 1) {
continue;
}
ExtendedType converter = translator
.getAdapter()
.getExtendedTypes()
.getRegisteredType(attribute.getType());
Collection<ColumnOverride> overrides = columnOverrides.get(entity.getName());
if (overrides == null) {
overrides = new ArrayList<ColumnOverride>(3);
columnOverrides.put(entity.getName(), overrides);
}
overrides.add(new ColumnOverride(index, key, converter, jdbcType));
}