18 package org.turro.financials.entity;
20 import java.util.Collection;
21 import java.util.Collections;
22 import java.util.Date;
23 import java.util.HashSet;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.FetchType;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.OneToMany;
32 import javax.persistence.OneToOne;
33 import org.turro.financials.db.FinancialsPU;
34 import org.turro.financials.model.document.BatchOfType;
41 public class BatchOf implements java.io.Serializable {
44 @GeneratedValue(strategy=GenerationType.IDENTITY)
45 @Column(name=
"IDENTIFIER")
56 @OneToMany(fetch = FetchType.EAGER)
57 private Set<Document> documents =
new HashSet<Document>();
72 this.documents = documents;
106 batch.setDocumentDate(date);
110 doc.setDocumentDate(date);
117 batch.setReceiptDate(date);
121 doc.setReceiptDate(date);
129 if(store ==
null || batch ==
null || !(batch.isValid())) {
136 return (document ==
null || document.
getId() == 0) ? Collections.EMPTY_LIST :
138 "select batch from BatchOf as batch " +
139 "where batch.batch = ? " +
140 "or ? member of batch.documents",
void setReceiptDate(Date date)
void setType(BatchOfType type)
void setStore(Contract store)
void setDocumentDate(Date date)
static Collection< BatchOf > getFrom(Document document)
void setDocuments(Set< Document > documents)
void setBatch(Document batch)
Set< Document > getDocuments()