Skip to content

Commit 072be8a

Browse files
labkey-matthewblabkey-martyplabkey-adam
authored
DatabaseIdentifier (#937)
* DatabaseIdentifier ColumnInfo.getAlias() ColumnInfo.getSelectName() * cleanup --------- Co-authored-by: Marty Pradere <martyp@labkey.com> Co-authored-by: Adam Rauch <adam@labkey.com>
1 parent fe6a2c4 commit 072be8a

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

ehr/api-src/org/labkey/api/ehr/demographics/AbstractDemographicsProvider.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,10 @@ public Map<String, Map<String, Object>> getProperties(DefaultSchema defaultSchem
116116
public void exec(ResultSet object) throws SQLException
117117
{
118118
Results rs = new ResultsImpl(object, cols);
119+
String id = ti.getColumn("Id").getStringValue(rs);
119120

120-
String id = rs.getString(FieldKey.fromString(ti.getColumn("Id").getAlias()));
121-
122-
Map<String, Object> map = ret.get(id);
123-
if (map == null)
124-
map = new TreeMap<>();
125-
121+
Map<String, Object> map = ret.computeIfAbsent(id, (x)->new TreeMap<>());
126122
processRow(rs, cols, map);
127-
128-
ret.put(id, map);
129123
}
130124
});
131125
if (debugEnabled)

ehr/api-src/org/labkey/api/ehr/demographics/WeightsDemographicsProvider.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,10 @@ public Map<String, Map<String, Object>> getProperties(DefaultSchema defaultSchem
8585
public void exec(ResultSet object) throws SQLException
8686
{
8787
Results rs = new ResultsImpl(object, cols);
88+
String id = ti.getColumn("Id").getStringValue(rs);
8889

89-
String id = rs.getString(FieldKey.fromString(ti.getColumn("Id").getAlias()));
90-
91-
Map<String, Object> map = ret.get(id);
92-
if (map == null)
93-
map = new HashMap<>();
94-
90+
Map<String, Object> map = ret.computeIfAbsent(id, (x)->new HashMap<>());
9591
processRow(rs, cols, map);
96-
97-
ret.put(id, map);
9892
}
9993
});
10094
}

0 commit comments

Comments
 (0)