package com.gpc.tams.repository.inventory; import com.gpc.tams.repository.IdLocationPair; import java.io.Serializable; import java.math.BigDecimal; import java.sql.Timestamp; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; /** * */ @Entity @Table(name=InventoryStockLocation.TABLE_NAME) @IdClass(IdLocationPair.class) @NamedQueries({ @NamedQuery(name="InventoryStockLocation.selectByInventoryIdLocation", query="SELECT i FROM InventoryStockLocation i WHERE (i.inventoryId = :inventoryId) AND (i.location = :location)"), @NamedQuery(name="InventoryStockLocation.selectByInventoryIdStockLocation", query="SELECT i FROM InventoryStockLocation i WHERE (i.inventoryId = :inventoryId) AND (i.stockLocation = :stockLocation) AND (i.location = :location)"), @NamedQuery(name="InventoryStockLocation.selectByLineAbbrevPartNumberStockLocation", query="SELECT isl FROM InventoryStockLocation isl,Inventory i WHERE (isl.inventoryId = i.id) AND (isl.location = i.location) AND (i.lineAbbrev = :lineAbbrev) AND (i.partNumber = :partNumber) AND (i.location = :location)") }) public class InventoryStockLocation implements Serializable { public static final String TABLE_NAME = "INVENTORY_STOCK_LOCATION"; @Id @Column(name="ID", nullable=false) private int id; @Id @Column(name="LOC", nullable=false) private int location; @Column(name="INVENTORY_ID", nullable=false) private int inventoryId; @Column(name="STOCK_LOCATION", length=6, nullable=false) private String stockLocation; @Column(name="PLANOGRAM_REFERENCE", length=6) private String planogramReference; @Column(name="REF_BIN_LABEL_TYPE_ID") private Integer refBinLabelTypeId; @Column(name="LABEL_REQUIRED", length=1, nullable=false) @org.hibernate.annotations.Type(type="yes_no") private boolean labelRequired; @Column(name="NUMBER_OF_FACINGS", nullable=false) private int numberOfFacings; @Column(name="DISPLAY_QTY", nullable=false) private BigDecimal displayQuantity; @Column(name="LAST_MODIFIED_DATE", nullable=false) private Timestamp lastModifiedDate; @Column(name="MODIFIED_BY_EMPLOYEE_ID") private Integer modifiedByEmployeeId; @Column(name="FILENAME", length=8) private String filename; private transient String lineAbbrev; private transient String partNumber; private transient InventoryStockLocationChangeQueue inventoryStockLocationChangeQueue; public void setDefaults() { setLabelRequired( false ); setNumberOfFacings( 0 ); setDisplayQuantity( BigDecimal.ZERO ); } public BigDecimal getDisplayQuantity() { return displayQuantity; } public void setDisplayQuantity( BigDecimal displayQuantity ) { this.displayQuantity = displayQuantity; } public String getFilename() { return filename; } public void setFilename( String filename ) { this.filename = filename; } public int getId() { return id; } public void setId( int id ) { this.id = id; } public int getInventoryId() { return inventoryId; } public void setInventoryId( int inventoryId ) { this.inventoryId = inventoryId; } public boolean isLabelRequired() { return labelRequired; } public void setLabelRequired( boolean labelRequired ) { this.labelRequired = labelRequired; } public Timestamp getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate( Timestamp lastModifiedDate ) { this.lastModifiedDate = lastModifiedDate; } public int getLocation() { return location; } public void setLocation( int location ) { this.location = location; } public Integer getModifiedByEmployeeId() { return modifiedByEmployeeId; } public void setModifiedByEmployeeId( Integer modifiedByEmployeeId ) { this.modifiedByEmployeeId = modifiedByEmployeeId; } public int getNumberOfFacings() { return numberOfFacings; } public void setNumberOfFacings( int numberOfFacings ) { this.numberOfFacings = numberOfFacings; } public String getPlanogramReference() { return planogramReference; } public void setPlanogramReference( String planogramReference ) { this.planogramReference = planogramReference; } public Integer getRefBinLabelTypeId() { return refBinLabelTypeId; } public void setRefBinLabelTypeId( Integer refBinLabelTypeId ) { this.refBinLabelTypeId = refBinLabelTypeId; } public String getStockLocation() { return stockLocation; } public void setStockLocation( String stockLocation ) { this.stockLocation = stockLocation; } public String getLineAbbrev() { return lineAbbrev; } public void setLineAbbrev(String lineAbbrev) { this.lineAbbrev = lineAbbrev; } public String getPartNumber() { return partNumber; } public void setPartNumber(String partNumber) { this.partNumber = partNumber; } public InventoryStockLocationChangeQueue getInventoryStockLocationChangeQueue() { return inventoryStockLocationChangeQueue; } public void setInventoryStockLocationChangeQueue( InventoryStockLocationChangeQueue inventoryStockLocationChangeQueue) { this.inventoryStockLocationChangeQueue = inventoryStockLocationChangeQueue; } }