package org.xmx0632.deliciousfruit.entity; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.validation.constraints.NotNull; import org.apache.commons.lang3.builder.ToStringBuilder; /** * OrderProductFree. */ @Entity @Table(name = "tbl_order_product_free") public class OrderProductFree extends IdEntity { private Order order; private String productName; private int quantity; private String unit; private String spec; private String productId; public String getProductId() { return productId; } public void setProductId(String productId) { this.productId = productId; } public OrderProductFree() { } public OrderProductFree(Order order, String productName, int quantity) { this.order = order; this.productName = productName; this.quantity = quantity; } @ManyToOne @JoinColumn(name = "order_id") public Order getOrder() { return order; } public void setOrder(Order order) { this.order = order; } @NotNull public String getProductName() { return this.productName; } public void setProductName(String productName) { this.productName = productName; } @NotNull public int getQuantity() { return this.quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public String getUnit() { return this.unit; } public void setUnit(String unit) { this.unit = unit; } public String getSpec() { return this.spec; } public void setSpec(String spec) { this.spec = spec; } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } }