Skip to content

Commit b032b92

Browse files
committed
removes imports
1 parent 21bb9ad commit b032b92

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/DocumentQueryConversor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public static QueryResult createQuery(IDocumentSession session, DocumentQuery qu
4343
IDocumentQuery<HashMap> ravenQuery = session.query(HashMap.class, Query.collection(query.getDocumentCollection()));
4444
query.getCondition().ifPresent(c -> feedQuery(ravenQuery, c, ids));
4545

46-
4746
if (!ids.isEmpty() && query.getCondition().isPresent()) {
4847
return new QueryResult(ids, null);
4948
} else {
@@ -81,7 +80,12 @@ private static void feedQuery(IDocumentQuery<HashMap> ravenQuery, DocumentCondit
8180
String name = document.getName();
8281

8382
if (EntityConverter.ID_FIELD.equals(name)) {
84-
ids.add(value.toString());
83+
if (value instanceof Iterable) {
84+
final Iterable iterable = Iterable.class.cast(value);
85+
iterable.forEach(i -> ids.add(i.toString()));
86+
} else {
87+
ids.add(value.toString());
88+
}
8589
return;
8690
}
8791

ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/EntityConverter.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ final class EntityConverter {
3535
private EntityConverter() {
3636
}
3737

38-
39-
public static String getId(Map entity) {
40-
Map<String, Object> metadata = (Map<String, Object>) entity.remove(Constants.Documents.Metadata.KEY);
41-
return (String) metadata.get(Constants.Documents.Metadata.ID);
38+
public static String getId(Map<?, ?> entity) {
39+
if (entity != null) {
40+
Map<String, Object> metadata = (Map<String, Object>) entity.remove(Constants.Documents.Metadata.KEY);
41+
return (String) metadata.get(Constants.Documents.Metadata.ID);
42+
}
43+
return "";
4244
}
4345

4446
static DocumentEntity getEntity(Map map) {

0 commit comments

Comments
 (0)