Commit e0d3ddb0 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch 'ui-366-update-aclsid-class' into 'master'

Updated AclSid class: serialize the identity of the SID

See merge request genesys-pgr/application-blocks!35
parents 9fa54965 b38eb766
...@@ -21,10 +21,14 @@ import javax.persistence.Column; ...@@ -21,10 +21,14 @@ import javax.persistence.Column;
import javax.persistence.MappedSuperclass; import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist; import javax.persistence.PrePersist;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
/** /**
* The Class UuidEntity. * The Class UuidEntity.
*/ */
@MappedSuperclass @MappedSuperclass
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "uuid")
public abstract class UuidModel extends AuditedVersionedModel implements IdUUID { public abstract class UuidModel extends AuditedVersionedModel implements IdUUID {
/** The Constant serialVersionUID. */ /** The Constant serialVersionUID. */
......
...@@ -30,6 +30,7 @@ import javax.persistence.OneToMany; ...@@ -30,6 +30,7 @@ import javax.persistence.OneToMany;
import javax.persistence.Table; import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.ObjectIdGenerators; import com.fasterxml.jackson.annotation.ObjectIdGenerators;
...@@ -51,7 +52,7 @@ import org.hibernate.annotations.DiscriminatorOptions; ...@@ -51,7 +52,7 @@ import org.hibernate.annotations.DiscriminatorOptions;
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.INTEGER) @DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue(value = "0") @DiscriminatorValue(value = "0")
@DiscriminatorOptions(force = false) @DiscriminatorOptions(force = false)
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "sid")
public class AclSid extends AuditedVersionedModel { public class AclSid extends AuditedVersionedModel {
/** The Constant serialVersionUID. */ /** The Constant serialVersionUID. */
...@@ -62,6 +63,7 @@ public class AclSid extends AuditedVersionedModel { ...@@ -62,6 +63,7 @@ public class AclSid extends AuditedVersionedModel {
private boolean principal; private boolean principal;
/** The sid. */ /** The sid. */
@JsonIdentityReference(alwaysAsId = true)
@Column(name = "sid", nullable = false, length = 100) @Column(name = "sid", nullable = false, length = 100)
private String sid; private String sid;
......
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