Commit ff4c3cfb authored by Daniel Gerhardt's avatar Daniel Gerhardt

Only serialize explicitly annotated properties for CouchDB

parent 2c822151
......@@ -17,6 +17,7 @@
*/
package de.thm.arsnova.entities.serialization;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.ektorp.CouchDbConnector;
import org.ektorp.impl.StdObjectMapperFactory;
......@@ -24,6 +25,8 @@ import org.ektorp.impl.StdObjectMapperFactory;
public class CouchDbObjectMapperFactory extends StdObjectMapperFactory {
public ObjectMapper createObjectMapper(CouchDbConnector connector) {
ObjectMapper om = super.createObjectMapper(connector);
om.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false);
om.setConfig(om.getSerializationConfig().withView(View.Persistence.class));
om.registerModule(new CouchDbDocumentModule());
return om;
......
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