|
|
@ -19,7 +19,8 @@ import org.hibernate.annotations.LazyCollectionOption;
|
|
|
|
|
|
|
|
|
|
|
|
@Entity
|
|
|
|
@Entity
|
|
|
|
@Table(name = "ORDERS")
|
|
|
|
@Table(name = "ORDERS")
|
|
|
|
public class Order extends BaseData {
|
|
|
|
public class Order extends BaseData
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
@Column(name = "NUMSER")
|
|
|
|
@Column(name = "NUMSER")
|
|
|
|
private String numser;
|
|
|
|
private String numser;
|
|
|
@ -43,8 +44,7 @@ public class Order extends BaseData {
|
|
|
|
@AttributeOverride(name = "state", column = @Column(name = "SUPPLIER_STATE")),
|
|
|
|
@AttributeOverride(name = "state", column = @Column(name = "SUPPLIER_STATE")),
|
|
|
|
@AttributeOverride(name = "street", column = @Column(name = "SUPPLIER_STREET")),
|
|
|
|
@AttributeOverride(name = "street", column = @Column(name = "SUPPLIER_STREET")),
|
|
|
|
@AttributeOverride(name = "web", column = @Column(name = "SUPPLIER_WEB")),
|
|
|
|
@AttributeOverride(name = "web", column = @Column(name = "SUPPLIER_WEB")),
|
|
|
|
@AttributeOverride(name = "zipCode", column = @Column(name = "SUPPLIER_ZIP_CODE"))
|
|
|
|
@AttributeOverride(name = "zipCode", column = @Column(name = "SUPPLIER_ZIP_CODE")) })
|
|
|
|
})
|
|
|
|
|
|
|
|
private AddressEmb suplier;
|
|
|
|
private AddressEmb suplier;
|
|
|
|
|
|
|
|
|
|
|
|
@Embedded
|
|
|
|
@Embedded
|
|
|
@ -63,8 +63,7 @@ public class Order extends BaseData {
|
|
|
|
@AttributeOverride(name = "state", column = @Column(name = "INVOICE_STATE")),
|
|
|
|
@AttributeOverride(name = "state", column = @Column(name = "INVOICE_STATE")),
|
|
|
|
@AttributeOverride(name = "street", column = @Column(name = "INVOICE_STREET")),
|
|
|
|
@AttributeOverride(name = "street", column = @Column(name = "INVOICE_STREET")),
|
|
|
|
@AttributeOverride(name = "web", column = @Column(name = "INVOICE_WEB")),
|
|
|
|
@AttributeOverride(name = "web", column = @Column(name = "INVOICE_WEB")),
|
|
|
|
@AttributeOverride(name = "zipCode", column = @Column(name = "INVOICE_ZIP_CODE"))
|
|
|
|
@AttributeOverride(name = "zipCode", column = @Column(name = "INVOICE_ZIP_CODE")) })
|
|
|
|
})
|
|
|
|
|
|
|
|
private AddressEmb address;
|
|
|
|
private AddressEmb address;
|
|
|
|
|
|
|
|
|
|
|
|
@Embedded
|
|
|
|
@Embedded
|
|
|
@ -83,8 +82,7 @@ public class Order extends BaseData {
|
|
|
|
@AttributeOverride(name = "state", column = @Column(name = "DELIVERY_STATE")),
|
|
|
|
@AttributeOverride(name = "state", column = @Column(name = "DELIVERY_STATE")),
|
|
|
|
@AttributeOverride(name = "street", column = @Column(name = "DELIVERY_STREET")),
|
|
|
|
@AttributeOverride(name = "street", column = @Column(name = "DELIVERY_STREET")),
|
|
|
|
@AttributeOverride(name = "web", column = @Column(name = "DELIVERY_WEB")),
|
|
|
|
@AttributeOverride(name = "web", column = @Column(name = "DELIVERY_WEB")),
|
|
|
|
@AttributeOverride(name = "zipCode", column = @Column(name = "DELIVERY_ZIP_CODE"))
|
|
|
|
@AttributeOverride(name = "zipCode", column = @Column(name = "DELIVERY_ZIP_CODE")) })
|
|
|
|
})
|
|
|
|
|
|
|
|
private AddressEmb deliveryAddress;
|
|
|
|
private AddressEmb deliveryAddress;
|
|
|
|
|
|
|
|
|
|
|
|
@Column(name = "DELIVERY_DATE")
|
|
|
|
@Column(name = "DELIVERY_DATE")
|
|
|
@ -103,7 +101,7 @@ public class Order extends BaseData {
|
|
|
|
@LazyCollection(LazyCollectionOption.TRUE)
|
|
|
|
@LazyCollection(LazyCollectionOption.TRUE)
|
|
|
|
private List<OrderItem> items;
|
|
|
|
private List<OrderItem> items;
|
|
|
|
|
|
|
|
|
|
|
|
@Column(name = "TOTAL", precision=15, scale=4)
|
|
|
|
@Column(name = "TOTAL", precision = 15, scale = 4)
|
|
|
|
private BigDecimal total;
|
|
|
|
private BigDecimal total;
|
|
|
|
|
|
|
|
|
|
|
|
@Column(name = "ORDERED")
|
|
|
|
@Column(name = "ORDERED")
|
|
|
@ -118,133 +116,180 @@ public class Order extends BaseData {
|
|
|
|
@Column(name = "INVOICE_NUMBER")
|
|
|
|
@Column(name = "INVOICE_NUMBER")
|
|
|
|
private String invoiceNumber;
|
|
|
|
private String invoiceNumber;
|
|
|
|
|
|
|
|
|
|
|
|
public Order() {
|
|
|
|
@Column(name = "INVOICE_TOTAL", precision = 15, scale = 4)
|
|
|
|
items = new ArrayList<OrderItem>();
|
|
|
|
private BigDecimal invoiceTotal;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Order()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.items = new ArrayList<OrderItem>();
|
|
|
|
|
|
|
|
this.total = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
this.invoiceTotal = BigDecimal.ZERO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getNumser() {
|
|
|
|
public String getNumser()
|
|
|
|
|
|
|
|
{
|
|
|
|
return numser;
|
|
|
|
return numser;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setNumser(String numser) {
|
|
|
|
public void setNumser(String numser)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.numser = numser;
|
|
|
|
this.numser = numser;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AddressEmb getSuplier() {
|
|
|
|
public AddressEmb getSuplier()
|
|
|
|
|
|
|
|
{
|
|
|
|
return suplier;
|
|
|
|
return suplier;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setSuplier(AddressEmb suplier) {
|
|
|
|
public void setSuplier(AddressEmb suplier)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.suplier = suplier;
|
|
|
|
this.suplier = suplier;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AddressEmb getAddress() {
|
|
|
|
public AddressEmb getAddress()
|
|
|
|
|
|
|
|
{
|
|
|
|
return address;
|
|
|
|
return address;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setAddress(AddressEmb address) {
|
|
|
|
public void setAddress(AddressEmb address)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.address = address;
|
|
|
|
this.address = address;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Date getDeliveryDate() {
|
|
|
|
public Date getDeliveryDate()
|
|
|
|
|
|
|
|
{
|
|
|
|
return deliveryDate;
|
|
|
|
return deliveryDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setDeliveryDate(Date deliveryDate) {
|
|
|
|
public void setDeliveryDate(Date deliveryDate)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.deliveryDate = deliveryDate;
|
|
|
|
this.deliveryDate = deliveryDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getDeliveryType() {
|
|
|
|
public String getDeliveryType()
|
|
|
|
|
|
|
|
{
|
|
|
|
return deliveryType;
|
|
|
|
return deliveryType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setDeliveryType(String deliveryType) {
|
|
|
|
public void setDeliveryType(String deliveryType)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.deliveryType = deliveryType;
|
|
|
|
this.deliveryType = deliveryType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
public String getDescription()
|
|
|
|
|
|
|
|
{
|
|
|
|
return description;
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setDescription(String description) {
|
|
|
|
public void setDescription(String description)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.description = description;
|
|
|
|
this.description = description;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AddressEmb getDeliveryAddress() {
|
|
|
|
public AddressEmb getDeliveryAddress()
|
|
|
|
|
|
|
|
{
|
|
|
|
return deliveryAddress;
|
|
|
|
return deliveryAddress;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setDeliveryAddress(AddressEmb deliveryAddress) {
|
|
|
|
public void setDeliveryAddress(AddressEmb deliveryAddress)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.deliveryAddress = deliveryAddress;
|
|
|
|
this.deliveryAddress = deliveryAddress;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Date getDeliveredDate() {
|
|
|
|
public Date getDeliveredDate()
|
|
|
|
|
|
|
|
{
|
|
|
|
return deliveredDate;
|
|
|
|
return deliveredDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setDeliveredDate(Date deliveredDate) {
|
|
|
|
public void setDeliveredDate(Date deliveredDate)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.deliveredDate = deliveredDate;
|
|
|
|
this.deliveredDate = deliveredDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<OrderItem> getItems() {
|
|
|
|
public List<OrderItem> getItems()
|
|
|
|
|
|
|
|
{
|
|
|
|
return items;
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void addItem(OrderItem item) {
|
|
|
|
public void addItem(OrderItem item)
|
|
|
|
|
|
|
|
{
|
|
|
|
item.setOrder(this);
|
|
|
|
item.setOrder(this);
|
|
|
|
items.add(item);
|
|
|
|
items.add(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setItems(List<OrderItem> items) {
|
|
|
|
public void setItems(List<OrderItem> items)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.items = items;
|
|
|
|
this.items = items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isDelivered() {
|
|
|
|
public boolean isDelivered()
|
|
|
|
|
|
|
|
{
|
|
|
|
return delivered;
|
|
|
|
return delivered;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setDelivered(boolean delivered) {
|
|
|
|
public void setDelivered(boolean delivered)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.delivered = delivered;
|
|
|
|
this.delivered = delivered;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isInvoiced() {
|
|
|
|
public boolean isInvoiced()
|
|
|
|
|
|
|
|
{
|
|
|
|
return invoiced;
|
|
|
|
return invoiced;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setInvoiced(boolean invoiced) {
|
|
|
|
public void setInvoiced(boolean invoiced)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.invoiced = invoiced;
|
|
|
|
this.invoiced = invoiced;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getInvoiceNumber() {
|
|
|
|
public String getInvoiceNumber()
|
|
|
|
|
|
|
|
{
|
|
|
|
return invoiceNumber;
|
|
|
|
return invoiceNumber;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setInvoiceNumber(String invoiceNumber) {
|
|
|
|
public void setInvoiceNumber(String invoiceNumber)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.invoiceNumber = invoiceNumber;
|
|
|
|
this.invoiceNumber = invoiceNumber;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isOrdered() {
|
|
|
|
public boolean isOrdered()
|
|
|
|
|
|
|
|
{
|
|
|
|
return ordered;
|
|
|
|
return ordered;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setOrdered(boolean ordered) {
|
|
|
|
public void setOrdered(boolean ordered)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.ordered = ordered;
|
|
|
|
this.ordered = ordered;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Date getOrderDate() {
|
|
|
|
public Date getOrderDate()
|
|
|
|
|
|
|
|
{
|
|
|
|
return orderDate;
|
|
|
|
return orderDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setOrderDate(Date orderDate) {
|
|
|
|
public void setOrderDate(Date orderDate)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.orderDate = orderDate;
|
|
|
|
this.orderDate = orderDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public BigDecimal getTotal() {
|
|
|
|
public BigDecimal getTotal()
|
|
|
|
|
|
|
|
{
|
|
|
|
return total;
|
|
|
|
return total;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setTotal(BigDecimal total) {
|
|
|
|
public void setTotal(BigDecimal total)
|
|
|
|
|
|
|
|
{
|
|
|
|
this.total = total;
|
|
|
|
this.total = total;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BigDecimal getInvoiceTotal()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return invoiceTotal;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setInvoiceTotal(BigDecimal invoiceTotal)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.invoiceTotal = invoiceTotal;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|