Skip to content

Commit

Permalink
Implement support for hibernate timestamp columns with the 'with time…
Browse files Browse the repository at this point in the history
… zone' suffix.
  • Loading branch information
philipp-kleber-avelios committed Nov 28, 2024
1 parent 87529c4 commit b6b827a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ protected DataType toDataType(String hibernateType, Integer sqlTypeCode) throws
if (!matcher.matches()) {
return null;
}
DataType dataType = new DataType(matcher.group(1));
String typeName = matcher.group(1);
if (hibernateType.endsWith("with time zone")) {
typeName += " with timezone";
}
DataType dataType = new DataType(typeName);
if (matcher.group(3).isEmpty()) {
if (!matcher.group(2).isEmpty()) {
dataType.setColumnSize(Integer.parseInt(matcher.group(2)));
Expand All @@ -200,6 +204,8 @@ protected DataType toDataType(String hibernateType, Integer sqlTypeCode) throws
}
}

Scope.getCurrentScope().getLog(getClass()).info("Converted column data type - hibernate type: " + hibernateType + ", SQL type: " + sqlTypeCode + ", type name: " + typeName);

dataType.setDataTypeId(sqlTypeCode);
return dataType;
}
Expand Down

0 comments on commit b6b827a

Please sign in to comment.