77
, @NamedQuery(name = "Document.findByLocked", query = "SELECT d FROM
Document d WHERE d.locked = :locked")
, @NamedQuery(name = "Document.findAllInFolder", query = "SELECT d FROM
Document d WHERE d.idParentDocument.id = :idParentDocument")
, @NamedQuery(name = "Document.findAllInRootFolder", query = "SELECT d
FROM Document d WHERE d.idParentDocument = NULL")
})
public class Document implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Size(max = 255)
@Column(name = "title")
private String title;
@Lob
@Size(max = 10000000)
@Column(name = "description")
private String description;
@Column(name = "locked")
private Boolean locked;
@OneToMany(mappedBy = "idDocument")
private Collection<DocumentRule> documentRuleCollection;
@OneToMany(mappedBy = "idParentDocument")
private Collection<Document> documentCollection;
@JoinColumn(name = "id_parent_document", referencedColumnName = "id")
@ManyToOne
private Document idParentDocument;
@JoinColumn(name = "id_document_type", referencedColumnName = "id")
@ManyToOne
private DocumentType idDocumentType;
@JoinColumn(name = "id_user", referencedColumnName = "id")
@ManyToOne
private User idUser;
@Lob
@Column(name = "data")
private byte[] data;
@Column(name = "deleted")
private Boolean deleted;
@OneToMany(mappedBy = "idDocument", cascade = {CascadeType.ALL})
private Collection<DocumentHistory> documentHistoryCollection;