Skip to content

Commit 3c1ae94

Browse files
committed
feat: include field validation
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
1 parent 26fb888 commit 3c1ae94

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jnosql-oracle-nosql/src/main/java/org/eclipse/jnosql/databases/oracle/communication/DefaultOracleNoSQLDocumentManager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ public Stream<CommunicationEntity> select(SelectQuery query) {
173173
}
174174
if (!oracleQuery.hasOnlyIds()) {
175175
LOGGER.finest("Executing Oracle Query: " + oracleQuery.query());
176-
177176
entities.addAll(executeSQL(oracleQuery.query(), oracleQuery.params()));
178177
}
179178
return entities.stream();
@@ -227,7 +226,6 @@ private List<CommunicationEntity> getIds(OracleQuery oracleQuery, String table)
227226
entities.add(documentEntity);
228227
}
229228
}
230-
231229
return entities;
232230
}
233231

@@ -279,7 +277,8 @@ private List<CommunicationEntity> executeSQL(String sql, List<FieldValue> params
279277
entity.add(Element.of(entry.getKey(), FieldValueConverter.INSTANCE.of(entry.getValue())));
280278
}
281279
}
282-
entity.add(Element.of(ID, result.get(ORACLE_ID).asString().getValue()));
280+
var id = result.get(ORACLE_ID).asString().getValue().split(":")[1];
281+
entity.add(Element.of(ID, id));
283282
entities.add(entity);
284283
}
285284
} while (!queryRequest.isDone());
@@ -307,6 +306,9 @@ private void put(CommunicationEntity entity, TimeToLive ttl) {
307306
}
308307

309308
private String generateId(String id, String table) {
309+
if(id.contains(":")) {
310+
return id;
311+
}
310312
return table + ":" + id;
311313
}
312314

0 commit comments

Comments
 (0)