Commit 130d63f2 authored by Matija Obreza's avatar Matija Obreza

Use JsonSidConverter in AuditedModel

parent a33008b7
......@@ -22,16 +22,27 @@ import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import org.genesys.blocks.model.BasicModel;
import org.genesys.blocks.util.JsonSidConverter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@MappedSuperclass
public abstract class AuditedModel extends BasicModel {
private static final long serialVersionUID = -5927214471682331909L;
@CreatedBy
@JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no)
@JsonProperty(access = Access.READ_ONLY)
private Long createdBy;
@CreatedDate
......@@ -39,6 +50,9 @@ public abstract class AuditedModel extends BasicModel {
private Date createdDate;
@LastModifiedBy
@JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no)
@JsonProperty(access = Access.READ_ONLY)
private Long lastModifiedBy;
@LastModifiedDate
......
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