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

Use JsonSidConverter in AuditedModel

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