Commit 222e0453 authored by Matija Obreza's avatar Matija Obreza

Do not deserialize Audited properties createdBy, lastModifiedBy from JSON

parent 7ef27f28
...@@ -29,6 +29,8 @@ import org.springframework.data.elasticsearch.annotations.Field; ...@@ -29,6 +29,8 @@ import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex; import org.springframework.data.elasticsearch.annotations.FieldIndex;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/** /**
...@@ -46,6 +48,7 @@ public abstract class AuditedVersionedModel extends VersionedModel { ...@@ -46,6 +48,7 @@ public abstract class AuditedVersionedModel extends VersionedModel {
@Column(updatable = false) @Column(updatable = false)
@JsonSerialize(converter = JsonSidConverter.class) @JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no) @Field(index = FieldIndex.no)
@JsonProperty(access = Access.READ_ONLY)
private Long createdBy; private Long createdBy;
/** The created date. */ /** The created date. */
...@@ -59,6 +62,7 @@ public abstract class AuditedVersionedModel extends VersionedModel { ...@@ -59,6 +62,7 @@ public abstract class AuditedVersionedModel extends VersionedModel {
@LastModifiedBy @LastModifiedBy
@JsonSerialize(converter = JsonSidConverter.class) @JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no) @Field(index = FieldIndex.no)
@JsonProperty(access = Access.READ_ONLY)
private Long lastModifiedBy; private Long lastModifiedBy;
/** The last modified date. */ /** The last modified date. */
......
...@@ -20,7 +20,9 @@ import java.util.Date; ...@@ -20,7 +20,9 @@ import java.util.Date;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.MappedSuperclass; import javax.persistence.MappedSuperclass;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.genesys.blocks.util.JsonSidConverter; import org.genesys.blocks.util.JsonSidConverter;
...@@ -46,6 +48,7 @@ public abstract class AuditedVersionedModelWithoutId extends VersionedModelWitho ...@@ -46,6 +48,7 @@ public abstract class AuditedVersionedModelWithoutId extends VersionedModelWitho
@Column(updatable = false) @Column(updatable = false)
@JsonSerialize(converter = JsonSidConverter.class) @JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no) @Field(index = FieldIndex.no)
@JsonProperty(access = Access.READ_ONLY)
private Long createdBy; private Long createdBy;
/** The created date. */ /** The created date. */
...@@ -59,6 +62,7 @@ public abstract class AuditedVersionedModelWithoutId extends VersionedModelWitho ...@@ -59,6 +62,7 @@ public abstract class AuditedVersionedModelWithoutId extends VersionedModelWitho
@LastModifiedBy @LastModifiedBy
@JsonSerialize(converter = JsonSidConverter.class) @JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no) @Field(index = FieldIndex.no)
@JsonProperty(access = Access.READ_ONLY)
private Long lastModifiedBy; private Long lastModifiedBy;
/** The last modified date. */ /** The last modified date. */
......
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