package org.marsik.elshelves.backend.entities;

import org.hibernate.validator.constraints.NotEmpty;
import org.marsik.elshelves.backend.services.StickerCapable;
import org.springframework.data.neo4j.annotation.NodeEntity;
import org.springframework.data.neo4j.annotation.RelatedTo;

import javax.validation.constraints.NotNull;
import java.net.URL;
import java.util.Date;
import java.util.Set;

@NodeEntity
public class Document extends NamedEntity implements StickerCapable {
	@NotEmpty
	String contentType;
	@NotNull
	Long size;

	@NotNull
	Date created;

    URL url;

	@RelatedTo(type = "DESCRIBES")
	Set<NamedEntity> describes;

	@PartOfUpdate
	public String getContentType() {
		return contentType;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	@PartOfUpdate
	public Long getSize() {
		return size;
	}

	public void setSize(Long size) {
		this.size = size;
	}

	@PartOfUpdate
	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Override
	public boolean canBeDeleted() {
		return true;
	}

	@Override
	public String getBaseUrl() {
		return "/documents";
	}

    @PartOfUpdate
    public URL getUrl() {
        return url;
    }

    public void setUrl(URL url) {
        this.url = url;
    }

	public Set<NamedEntity> getDescribes() {
		return describes;
	}

	public void setDescribes(Set<NamedEntity> describes) {
		this.describes = describes;
	}
}

@@ -90,24 +90,154 @@
 s.NotEmpty;%0A
+import org.marsik.elshelves.api.entities.DocumentApiModel;%0Aimport org.marsik.elshelves.backend.entities.fields.DefaultEmberModel;%0A
 import org.m
@@ -531,16 +531,59 @@
 eEntity%0A
+@DefaultEmberModel(DocumentApiModel.class)%0A
 public c

Add default ember model annotation to Document entity