Rev 21585 | Rev 21596 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.entity;import java.time.LocalDateTime;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.EnumType;import javax.persistence.Enumerated;import javax.persistence.GeneratedValue;import javax.persistence.GenerationType;import javax.persistence.Id;import javax.persistence.NamedQueries;import javax.persistence.NamedQuery;import javax.persistence.Table;import com.spice.profitmandi.dao.enumuration.ScanType;@NamedQueries({/*@NamedQuery(name="InventoryItem.findBySerialNumbers",query = "select it1 from InventoryItem it1 join"+ " (select it2.serialNumber, max(it2.created) as created from InventoryItem it2 where it2.serialNumber in (:serialNumbers) "+ " group by it2.serialNumber) b ON it1.serialNumber = b.serialNumber AND it1.created = b.created"),*/@NamedQuery(name = "InventoryItem.selectCount", query = "select count(ii) from InventoryItem ii"),@NamedQuery(name = "InventoryItem.selectByItemId", query = "select ii from InventoryItem ii where ii.itemId = :itemId"),@NamedQuery(name = "InventoryItem.selectByFofoId", query = "select ii from InventoryItem ii where ii.fofoId = :fofoId"),//@NamedQuery(name = "InventoryItem.selectBySerialNumber", query = "select ii from InventoryItem ii join Imei i on ii.imeiId = i.id where i.imei = :serialNumber"),//@NamedQuery(name = "InventoryItem.selectQuantitySum", query = "select sum(ii.initialQuantity) as inventoryQuantity from InventoryItem ii where ii.itemId = :itemId and ii.fofoId = :fofoId and ii.purchaseReference = :purchaseReference")@NamedQuery(name = "InventoryItem.selectScannedCount",query = "select ii.itemId, count(ii.initialQuantity) from InventoryItem ii where ii.itemId in :itemId and ii.fofoId = :fofoId and ii.purchaseReference = :purchaseReference group by ii.itemId")})@Entity@Table(name="fofo.inventory_item", schema = "fofo")public class InventoryItem {@Id@Column(name="id", unique=true, updatable=false)@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "item_id")private int itemId;@Column(name = "fofo_id")private int fofoId;@Column(name = "imei_id")private int imeiId;@Column(name = "intial_quantity")private int initialQuantity;@Column(name = "good_quantity")private int goodQuantity;@Column(name = "bad_quantity")private int badQuantity;@Column(name = "last_scan_type")@Enumerated(EnumType.STRING)private ScanType lastScanType;@Column(name = "purchase_reference")private String purchaseReference;@Column(name = "create_timestamp")private LocalDateTime createTimestamp;public int getId() {return id;}public void setId(int id) {this.id = id;}public int getItemId() {return itemId;}public void setItemId(int itemId) {this.itemId = itemId;}public int getFofoId() {return fofoId;}public void setFofoId(int fofoId) {this.fofoId = fofoId;}public int getImeiId() {return imeiId;}public void setImeiId(int imeiId) {this.imeiId = imeiId;}public int getInitialQuantity() {return initialQuantity;}public void setInitialQuantity(int initialQuantity) {this.initialQuantity = initialQuantity;}public int getGoodQuantity() {return goodQuantity;}public void setGoodQuantity(int goodQuantity) {this.goodQuantity = goodQuantity;}public int getBadQuantity() {return badQuantity;}public void setBadQuantity(int badQuantity) {this.badQuantity = badQuantity;}public ScanType getLastScanType() {return lastScanType;}public void setLastScanType(ScanType lastScanType) {this.lastScanType = lastScanType;}public String getPurchaseReference() {return purchaseReference;}public void setPurchaseReference(String purchaseReference) {this.purchaseReference = purchaseReference;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}}