@ -14,11 +14,12 @@ import javax.persistence.Table;
@Entity
@Entity
@Table ( name = "ORDER_ITEM" )
@Table ( name = "ORDER_ITEM" )
public class OrderItem {
public class OrderItem
{
@Id
@Id
@Column ( name = "ID" )
@Column ( name = "ID" )
@GeneratedValue
@GeneratedValue
private int id ;
private int id ;
@Column ( name = "CODE" )
@Column ( name = "CODE" )
@ -30,24 +31,21 @@ public class OrderItem {
@Column ( name = "TEXTITEM" )
@Column ( name = "TEXTITEM" )
private String textItem ;
private String textItem ;
@Column ( name = "QUANTITY" , precision = 15 , scale = 4 )
@Column ( name = "QUANTITY" , precision = 15 , scale = 4 )
private BigDecimal quantity ;
private BigDecimal quantity ;
@Embedded
@Embedded
private MUnitEmb munit ;
private MUnitEmb munit ;
@Column ( name = "UNITPRICE" , precision = 15 , scale = 4 )
@Column ( name = "UNITPRICE" , precision = 15 , scale = 4 )
private BigDecimal unitPrice ;
private BigDecimal unitPrice ;
@Column ( name = "TOTAL" , precision = 15 , scale = 4 )
@Column ( name = "TOTAL" , precision = 15 , scale = 4 )
private BigDecimal total ;
private BigDecimal total ;
@Column ( name = "DESCRIPTION" )
@Column ( name = "DESCRIPTION" )
private String description ;
private String description ;
@Column ( name = "TOTALINVOICE" , precision = 15 , scale = 4 )
private BigDecimal totalInvoice ;
@ManyToOne ( fetch = FetchType . EAGER )
@ManyToOne ( fetch = FetchType . EAGER )
@JoinColumn ( name = "REQUIREMENT_ITEM_ID" )
@JoinColumn ( name = "REQUIREMENT_ITEM_ID" )
private RequirementItem reqItem ;
private RequirementItem reqItem ;
@ -56,11 +54,13 @@ public class OrderItem {
@JoinColumn ( name = "ORDER_ID" )
@JoinColumn ( name = "ORDER_ID" )
private Order order ;
private Order order ;
public OrderItem ( ) {
public OrderItem ( )
{
super ( ) ;
super ( ) ;
}
}
public OrderItem ( RequirementItem reqItem ) {
public OrderItem ( RequirementItem reqItem )
{
super ( ) ;
super ( ) ;
this . reqItem = reqItem ;
this . reqItem = reqItem ;
this . code = reqItem . getCode ( ) ;
this . code = reqItem . getCode ( ) ;
@ -71,104 +71,115 @@ public class OrderItem {
this . munit = reqItem . getMunit ( ) ;
this . munit = reqItem . getMunit ( ) ;
this . total = reqItem . getTotal ( ) ;
this . total = reqItem . getTotal ( ) ;
this . description = reqItem . getDescription ( ) ;
this . description = reqItem . getDescription ( ) ;
this . totalInvoice = BigDecimal . ZERO ;
}
}
public int getId ( ) {
public int getId ( )
{
return id ;
return id ;
}
}
public void setId ( int id ) {
public void setId ( int id )
{
this . id = id ;
this . id = id ;
}
}
public String getCode ( ) {
public String getCode ( )
{
return code ;
return code ;
}
}
public void setCode ( String code ) {
public void setCode ( String code )
{
this . code = code ;
this . code = code ;
}
}
public String getName ( ) {
public String getName ( )
{
return name ;
return name ;
}
}
public void setName ( String name ) {
public void setName ( String name )
{
this . name = name ;
this . name = name ;
}
}
public String getTextItem ( ) {
public String getTextItem ( )
{
return textItem ;
return textItem ;
}
}
public void setTextItem ( String textItem ) {
public void setTextItem ( String textItem )
{
this . textItem = textItem ;
this . textItem = textItem ;
}
}
public BigDecimal getQuantity ( ) {
public BigDecimal getQuantity ( )
{
return quantity ;
return quantity ;
}
}
public void setQuantity ( BigDecimal quantity ) {
public void setQuantity ( BigDecimal quantity )
{
this . quantity = quantity ;
this . quantity = quantity ;
}
}
public MUnitEmb getMunit ( ) {
public MUnitEmb getMunit ( )
{
return munit ;
return munit ;
}
}
public void setMunit ( MUnitEmb munit ) {
public void setMunit ( MUnitEmb munit )
{
this . munit = munit ;
this . munit = munit ;
}
}
public BigDecimal getUnitPrice ( ) {
public BigDecimal getUnitPrice ( )
{
return unitPrice ;
return unitPrice ;
}
}
public void setUnitPrice ( BigDecimal unitPrice ) {
public void setUnitPrice ( BigDecimal unitPrice )
{
this . unitPrice = unitPrice ;
this . unitPrice = unitPrice ;
}
}
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 String getDescription ( ) {
public String getDescription ( )
{
return description ;
return description ;
}
}
public void setDescription ( String description ) {
public void setDescription ( String description )
this . description = description ;
}
public BigDecimal getTotalInvoice ( )
{
{
return totalInvoice ;
this . description = description ;
}
}
public void setTotalInvoice ( BigDecimal totalInvoice )
public RequirementItem getReqItem ( )
{
{
this . totalInvoice = totalInvoice ;
}
public RequirementItem getReqItem ( ) {
return reqItem ;
return reqItem ;
}
}
public void setReqItem ( RequirementItem reqItem ) {
public void setReqItem ( RequirementItem reqItem )
{
this . reqItem = reqItem ;
this . reqItem = reqItem ;
}
}
public Order getOrder ( ) {
public Order getOrder ( )
{
return order ;
return order ;
}
}
public void setOrder ( Order order ) {
public void setOrder ( Order order )
{
this . order = order ;
this . order = order ;
}
}