Commit c2757a21 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Exclude empty ids/revs from serialization for CouchDB

The creation of new documents is blocked if an empty _rev is set.
parent 7a1e6f50
......@@ -18,12 +18,20 @@
package de.thm.arsnova.entities.serialization;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(value = {"type"}, allowGetters = true)
public abstract class CouchDbDocumentMixIn {
@JsonProperty("_id") abstract String getId();
@JsonProperty("_id")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
abstract String getId();
@JsonProperty("_id") abstract void setId(String id);
@JsonProperty("_rev") abstract String getRevision();
@JsonProperty("_rev")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
abstract String getRevision();
@JsonProperty("_rev") abstract String setRevision(String rev);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment