Skip to content

Commit

Permalink
Test fix for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarrez committed Jul 16, 2024
1 parent 53130d5 commit e72ff6b
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,21 @@ public void validateColumnTypes(EntityHelperUtil.EntityMappingPackageInformation
private String findTable(String entity, String mappingFileContent) {

// CaseInstance is an exception: there's more ACT_RU_ENTITYLINK in there than case instance
String directMapping = null;
if (entity.equalsIgnoreCase("CaseInstance")) {
return "ACT_CMMN_RU_CASE_INST";
directMapping = "ACT_CMMN_RU_CASE_INST";
} else if (entity.equalsIgnoreCase("HistoricCaseInstance")) {
return "ACT_CMMN_HI_CASE_INST";
directMapping = "ACT_CMMN_HI_CASE_INST";
} else if (entity.equalsIgnoreCase("Privilege")) {
return "ACT_ID_PRIV";
directMapping = "ACT_ID_PRIV";
}

if (directMapping != null) {
if (databaseType.equals(AbstractEngineConfiguration.DATABASE_TYPE_POSTGRES)) {
return directMapping.toLowerCase(Locale.ROOT);
} else {
return directMapping;
}
}

// Simplistic approach: check for ${prefix}<TABLE> patterns. The one that is most in the mapping file, is most likely the table name.
Expand Down Expand Up @@ -147,6 +156,10 @@ private String findTable(String entity, String mappingFileContent) {
}
}

if (databaseType.equals(AbstractEngineConfiguration.DATABASE_TYPE_POSTGRES)) {
result = result.toLowerCase(Locale.ROOT);
}

return result.trim();
}

Expand Down Expand Up @@ -204,10 +217,12 @@ protected Map<String, String> getColumnMetaData(String tableName) {
columnType = EntityParameterTypesOverview.PARAMETER_TYPE_TIMESTAMP;

} else if (columnType.equalsIgnoreCase("int")
|| columnType.equalsIgnoreCase("int2") // postgres
|| columnType.equalsIgnoreCase("int4")) { // postgres
columnType = EntityParameterTypesOverview.PARAMETER_TYPE_INTEGER;

} else if (columnType.equalsIgnoreCase("int8")) { // postgres
} else if (columnType.equalsIgnoreCase("int8") // postgres
|| columnType.equalsIgnoreCase("serial")) { // postgres
columnType = EntityParameterTypesOverview.PARAMETER_TYPE_BIGINT;

} else if (columnType.equalsIgnoreCase("bit")
Expand Down

0 comments on commit e72ff6b

Please sign in to comment.