|
109 | 109 | import java.util.Set; |
110 | 110 | import java.util.TreeSet; |
111 | 111 |
|
| 112 | +import static org.labkey.api.exp.api.ExperimentService.asInteger; |
| 113 | +import static org.labkey.api.exp.api.ExperimentService.asLong; |
| 114 | + |
112 | 115 | public class EHRManager |
113 | 116 | { |
114 | 117 | private static final EHRManager _instance = new EHRManager(); |
@@ -315,7 +318,7 @@ public List<String> ensureStudyQCStates(Container c, final User u, final boolean |
315 | 318 | row.put("publicdata", qc[2]); |
316 | 319 | row = Table.insert(u, ti, row); |
317 | 320 |
|
318 | | - qcMap.put((String)row.get("label"), (Integer)row.get("rowid")); |
| 321 | + qcMap.put((String)row.get("label"), asInteger(row.get("rowid"))); |
319 | 322 |
|
320 | 323 | shouldClearCache = true; |
321 | 324 | } |
@@ -1111,24 +1114,24 @@ private void updatePropertyURI(Domain d, PropertyDescriptor pd) throws SQLExcept |
1111 | 1114 |
|
1112 | 1115 | //find propertyId |
1113 | 1116 | TableSelector ts = new TableSelector(propertyDescriptor, Collections.singleton("propertyid"), new SimpleFilter(FieldKey.fromString("PropertyURI"), pd.getPropertyURI()), null); |
1114 | | - Integer[] ids = ts.getArray(Integer.class); |
| 1117 | + Long[] ids = ts.getArray(Long.class); |
1115 | 1118 | if (ids.length == 0) |
1116 | 1119 | { |
1117 | 1120 | throw new SQLException("Unknown propertyURI: " + pd.getPropertyURI()); |
1118 | 1121 | } |
1119 | | - int propertyId = ids[0]; |
| 1122 | + long propertyId = ids[0]; |
1120 | 1123 |
|
1121 | 1124 | //first ensure the propertyURI exists |
1122 | 1125 | SQLFragment sql = new SQLFragment("select propertyid from exp.propertydomain p where domainId = ? AND propertyid in (select propertyid from exp.propertydescriptor pd where pd.name " + (expSchema.getSqlDialect().isPostgreSQL() ? "ilike" : "like") + " ?)", d.getTypeId(), pd.getName()); |
1123 | 1126 | SqlSelector selector = new SqlSelector(expSchema.getScope(), sql); |
1124 | | - List<Integer> oldIds = new ArrayList<>(); |
| 1127 | + List<Long> oldIds = new ArrayList<>(); |
1125 | 1128 |
|
1126 | 1129 | try (TableResultSet results = selector.getResultSet()) |
1127 | 1130 | { |
1128 | 1131 | while (results.next()) |
1129 | 1132 | { |
1130 | 1133 | Map<String, Object> row = results.getRowMap(); |
1131 | | - oldIds.add((Integer) row.get("propertyid")); |
| 1134 | + oldIds.add(asLong(row.get("propertyid"))); |
1132 | 1135 | } |
1133 | 1136 | } |
1134 | 1137 |
|
@@ -1171,7 +1174,7 @@ private void updatePropertyURI(Domain d, PropertyDescriptor pd) throws SQLExcept |
1171 | 1174 | executor.execute(updateSql, propertyId, d.getTypeId(), oldIds, minSort); |
1172 | 1175 |
|
1173 | 1176 | oldIds.remove(propertyId); |
1174 | | - for (Integer id : oldIds) |
| 1177 | + for (Long id : oldIds) |
1175 | 1178 | { |
1176 | 1179 | PropertyDescriptor toDelete = OntologyManager.getPropertyDescriptor(id); |
1177 | 1180 | if (toDelete != null) |
|
0 commit comments