Skip to content

Commit

Permalink
replace string concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
cstarcher committed Nov 29, 2023
1 parent 13f7f37 commit 26231a0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1086,18 +1086,18 @@ public void setColumnOrderingForMonthYearDateFormat(Sort sort, List<String> sqlA
StringBuilder value = new StringBuilder(table).append(".value, ");

if ("h2".equals(vireoDatabaseConfig.getPlatform())) {
value.append("PARSEDATETIME(").append(table).append(".value, 'MMM yyyy') AS");
value.append("PARSEDATETIME(").append(table).append(".value, 'MMM yyyy') AS ");
} else {
value.append("CAST(REPLACE(").append(table).append(".value, ' ', ' 1, ') AS DATE) AS");
value.append("CAST(REPLACE(").append(table).append(".value, ' ', ' 1, ') AS DATE) AS ");
}

value.append(" " + table).append("_date");
value.append(table).append("_date");

if (!sqlAliasBuilders.contains(value.toString())) {
sqlAliasBuilders.add(value.toString());
}

sqlOrderBysBuilder.append(" " + table).append("_date ").append(sort.name()).append(",");
sqlOrderBysBuilder.append(" ").append(table).append("_date ").append(sort.name()).append(",");
}
}

Expand Down

0 comments on commit 26231a0

Please sign in to comment.