diff --git a/openidm-repo-jdbc/src/main/java/org/forgerock/openidm/repo/jdbc/impl/mapper/ResultMappers.java b/openidm-repo-jdbc/src/main/java/org/forgerock/openidm/repo/jdbc/impl/mapper/ResultMappers.java index 3a0d0057b..868668707 100644 --- a/openidm-repo-jdbc/src/main/java/org/forgerock/openidm/repo/jdbc/impl/mapper/ResultMappers.java +++ b/openidm-repo-jdbc/src/main/java/org/forgerock/openidm/repo/jdbc/impl/mapper/ResultMappers.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import java.sql.SQLException; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -76,9 +77,10 @@ public ResultMapper> forTotalCount() { * @return object reference result mapper */ public ResultMapper> forObjectRef(boolean revision) throws SQLException { + // create mutable map because there are unfortunately components that want to mutate it return revision - ? rs -> Map.of("_id", rs.getString("objectid"), "_rev", rs.getString("rev")) - : rs -> Map.of("_id", rs.getString("objectid")); + ? rs -> new LinkedHashMap<>(Map.of("_id", rs.getString("objectid"), "_rev", rs.getString("rev"))) + : rs -> new LinkedHashMap<>(Map.of("_id", rs.getString("objectid"))); } }