diff --git a/stardao-dynamodb/src/main/java/io/stardog/stardao/dynamodb/mapper/JacksonItemMapper.java b/stardao-dynamodb/src/main/java/io/stardog/stardao/dynamodb/mapper/JacksonItemMapper.java index 79a113d..80dca0c 100644 --- a/stardao-dynamodb/src/main/java/io/stardog/stardao/dynamodb/mapper/JacksonItemMapper.java +++ b/stardao-dynamodb/src/main/java/io/stardog/stardao/dynamodb/mapper/JacksonItemMapper.java @@ -104,7 +104,9 @@ protected Item renameItem(Item item, Map renames) { Item renamedItem = new Item(); for (String key : map.keySet()) { String renamedKey = renames.getOrDefault(key, key); - renamedItem.with(renamedKey, item.get(key)); + if (renamedKey != null && !"".equals(renamedKey)) { + renamedItem.with(renamedKey, item.get(key)); + } } return renamedItem; } diff --git a/stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/JacksonDocumentMapper.java b/stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/JacksonDocumentMapper.java index 08d32ac..3de7317 100644 --- a/stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/JacksonDocumentMapper.java +++ b/stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/JacksonDocumentMapper.java @@ -109,7 +109,9 @@ protected Document renameDocument(Document doc, Map renames) { Document renamedDoc = new Document(); for (String key : doc.keySet()) { String renamedKey = renames.getOrDefault(key, key); - renamedDoc.put(renamedKey, doc.get(key)); + if (renamedKey != null && !"".equals(renamedKey)) { + renamedDoc.put(renamedKey, doc.get(key)); + } } return renamedDoc; }