Skip to content

Commit 960c425

Browse files
authored
Merge pull request #1782 from IBM/fix-sp-fun
Signed-off-by: Lee Surprenant <[email protected]>
2 parents 21ef115 + 6833eb5 commit 960c425

File tree

4 files changed

+143
-76
lines changed

4 files changed

+143
-76
lines changed

fhir-database-utils/src/main/java/com/ibm/fhir/database/utils/version/GetLatestVersionDAO.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public Map<String,Integer> run(IDatabaseTranslator translator, Connection c) {
5050
final String cols = DataDefinitionUtil.join(SchemaConstants.SCHEMA_NAME, SchemaConstants.OBJECT_TYPE, SchemaConstants.OBJECT_NAME);
5151
final String sql = "SELECT " + cols
5252
+ ", max(" + SchemaConstants.VERSION + ") FROM " + tbl
53-
+ " WHERE " + SchemaConstants.SCHEMA_NAME + " IN (?, ?) "
53+
+ " WHERE UPPER(" + SchemaConstants.SCHEMA_NAME + ") IN (?, ?) "
5454
+ " GROUP BY " + cols;
5555

5656
// Fetch the current version history information for both the admin and specified data schemas
@@ -59,7 +59,7 @@ public Map<String,Integer> run(IDatabaseTranslator translator, Connection c) {
5959
ps.setString(2, schemaName);
6060
ResultSet rs = ps.executeQuery();
6161
while (rs.next()) {
62-
String schema = rs.getString(1);
62+
String schema = rs.getString(1).toUpperCase();
6363
String type = rs.getString(2);
6464
String name = rs.getString(3);
6565
int version = rs.getInt(4);

fhir-database-utils/src/main/java/com/ibm/fhir/database/utils/version/VersionHistoryService.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public VersionHistoryService(String adminSchemaName, String... schemaNames) {
4444

4545
/**
4646
* For injection of the {@link IConnectionProvider}
47-
*
47+
*
4848
* @param tp
4949
*/
5050
public void setTransactionProvider(ITransactionProvider tp) {
@@ -53,7 +53,7 @@ public void setTransactionProvider(ITransactionProvider tp) {
5353

5454
/**
5555
* For injection of the {@link IDatabaseTarget}
56-
*
56+
*
5757
* @param tgt
5858
*/
5959
public void setTarget(IDatabaseAdapter tgt) {
@@ -108,7 +108,7 @@ private void getLatestVersionHistoryForSchema() {
108108
/**
109109
* Insert all the entries in the versionHistoryMap. This must be called in the
110110
* context of an existing transaction
111-
*
111+
*
112112
* @param versionHistories
113113
*/
114114
public void insertVersionHistoriesInTx(Collection<TypeNameVersion> versionHistories) {
@@ -133,7 +133,7 @@ public void insertVersionHistoryInTx(String objectSchema, String objectType, Str
133133
/**
134134
* Insert all the entries in the versionHistoryMap in a new transaction (useful
135135
* for testing).
136-
*
136+
*
137137
* @param versionHistories
138138
*/
139139
public void insertVersionHistory(Collection<TypeNameVersion> versionHistories) {
@@ -208,4 +208,4 @@ public boolean applies(String objectSchema, String objectType, String objectName
208208
Integer currentVersion = this.versionHistoryMap.get(key);
209209
return currentVersion == null || currentVersion < changeVersion;
210210
}
211-
}
211+
}

0 commit comments

Comments
 (0)