SourceDocument.java
package com.tradecloud.domain.document;
import com.tradecloud.common.base.PersistenceBase;
import com.tradecloud.domain.model.organisationalunit.OrganisationalUnit;
import com.tradecloud.domain.party.Employee;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "sourcedocument")
@Access(AccessType.FIELD)
@XmlAccessorType(XmlAccessType.FIELD)
public class SourceDocument extends PersistenceBase implements Serializable {
private static final long serialVersionUID = 1L;
@Temporal(TemporalType.TIMESTAMP)
private Date dateCreated;
@Temporal(TemporalType.TIMESTAMP)
private Date documentDate;
private String number;
private String reference;
@ManyToOne
private Employee seller;
// TODO - link to person? or just a name?
private Integer authorisedById;
private String comments;
@OneToOne
private OrganisationalUnit organisationalUnit;
private String loadingWarehouse;
public SourceDocument() {
}
public SourceDocument(/* int id, */Date dateCreated, int clientId) {
this.dateCreated = dateCreated;
}
public SourceDocument(/* int id, */Date dateCreated, Date documentDate, String number, String reference, Integer sellerId,
Integer authorisedById, String comments, int clientId, Integer organisationalUnit, Integer loadingWarehouseId) {
this.dateCreated = dateCreated;
this.documentDate = documentDate;
this.number = number;
this.reference = reference;
this.authorisedById = authorisedById;
this.comments = comments;
}
public Date getDateCreated() {
return this.dateCreated;
}
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
}
public Date getDocumentDate() {
return this.documentDate;
}
public void setDocumentDate(Date documentDate) {
this.documentDate = documentDate;
}
public String getNumber() {
return this.number;
}
public void setNumber(String number) {
this.number = number;
}
public String getReference() {
return this.reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public Integer getAuthorisedById() {
return this.authorisedById;
}
public void setAuthorisedById(Integer authorisedById) {
this.authorisedById = authorisedById;
}
public String getComments() {
return this.comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public Employee getSeller() {
return seller;
}
public void setSeller(Employee seller) {
this.seller = seller;
}
public OrganisationalUnit getOrganisationalUnit() {
return organisationalUnit;
}
public void setOrganisationalUnit(OrganisationalUnit organisationalUnit) {
this.organisationalUnit = organisationalUnit;
}
public String getString() {
return loadingWarehouse;
}
public void setString(String loadingWarehouse) {
this.loadingWarehouse = loadingWarehouse;
}
}