Skip to content

Commit

Permalink
TEIIDDES-1918 Resolve type mapping issue in RelationalModelProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrillin committed Nov 15, 2013
1 parent d392a14 commit 87a990e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1446,14 +1446,14 @@ protected EObject findType( int jdbcType,
jdbcType = Types.BINARY;
}

// First look up by type code ...
result = findType(jdbcType, problems);
// First look up by name
result = findType(typeName, problems);
if (result != null) {
return result;
}

// Still haven't found one, so look it up by name ...
result = findType(typeName, problems);
// Still haven't found one, so look it up by typeCode ...
result = findType(jdbcType, problems);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,16 @@ protected String getIdentifier( final EObject datatype ) {
public EObject getDatatype( final String jdbcTypeName ) throws ModelerCoreException {
EObject result = null;
if (jdbcTypeName != null) {
Integer typeCode = SQL_TYPE_MAPPING.get(jdbcTypeName.toUpperCase());
if (typeCode != null) {
result = getDatatype(typeCode);
}
// Look for direct match to Built-in types first
result = this.datatypeManager.getBuiltInDatatype(jdbcTypeName);

// No direct match, so look for jdbc type
if(result == null) {
Integer typeCode = SQL_TYPE_MAPPING.get(jdbcTypeName.toUpperCase());
if (typeCode != null) {
result = getDatatype(typeCode);
}
}
}
if (result == null) {
result = findDatatype(DatatypeConstants.BuiltInNames.OBJECT);
Expand Down

0 comments on commit 87a990e

Please sign in to comment.