Commit 749fdca1 authored by Artem Hrybeniuk's avatar Artem Hrybeniuk
Browse files

SuperModelFilter: java time module for mappers

parent 90b3dcfe
......@@ -137,5 +137,12 @@
<version>${spring.security.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -105,6 +105,13 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
......
......@@ -44,6 +44,7 @@ import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.ContextualDeserializer;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
......@@ -69,6 +70,12 @@ public abstract class SuperModelFilter<T extends SuperModelFilter<T, R>, R> impl
jsonizer.setSerializationInclusion(JsonInclude.Include.NON_NULL);
nonDefault.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
defaultMapper.setSerializationInclusion(JsonInclude.Include.USE_DEFAULTS);
// JSR310 java.time
var javaTimeModule = new JavaTimeModule();
jsonizer.registerModule(javaTimeModule);
nonDefault.registerModule(javaTimeModule);
defaultMapper.registerModule(javaTimeModule);
}
/** The negative filters, but don't de-/serialize it's own NOT-properties. */
......
Supports Markdown
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