Commit cf98e1f0 authored by Matija Obreza's avatar Matija Obreza

Added JSON views

parent 3ded77e4
Pipeline #6729 passed with stage
in 2 minutes and 2 seconds
......@@ -33,6 +33,7 @@ import javax.persistence.Table;
import org.genesys.blocks.model.AuditedVersionedModel;
import org.genesys.blocks.model.Copyable;
import org.genesys.blocks.model.JsonViews;
import org.genesys.blocks.security.model.AclAwareModel;
import org.hibernate.annotations.Type;
......@@ -40,6 +41,7 @@ import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
......@@ -86,6 +88,7 @@ public class ImageGallery extends AuditedVersionedModel implements AclAwareModel
@ManyToMany(cascade = { CascadeType.REFRESH })
@JoinTable(name = "repository_gallery_image", joinColumns = @JoinColumn(name = "galleryId"), inverseJoinColumns = @JoinColumn(name = "imageId"))
@OrderColumn(name = "position")
@JsonView({ JsonViews.Root.class })
private List<RepositoryImage> images;
/** The folder. */
......
......@@ -32,6 +32,7 @@ import javax.persistence.PrePersist;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.genesys.blocks.model.JsonViews;
import org.genesys.blocks.model.UuidModel;
import org.genesys.blocks.security.model.AclAwareModel;
import org.genesys.filerepository.InvalidRepositoryPathException;
......@@ -41,6 +42,7 @@ import org.hibernate.annotations.Type;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
/**
......@@ -73,6 +75,7 @@ public class RepositoryFolder extends UuidModel implements AclAwareModel {
@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "parent")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "path")
@JsonIdentityReference(alwaysAsId = true)
@JsonView({ JsonViews.Root.class })
private List<RepositoryFolder> children;
/** List of files in this folder. */
......
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