1 6 7 package com.sun.javaee.blueprints.autoid.model; 8 9 import javax.persistence.*; 10 11 @Entity 12 13 public class Item implements java.io.Serializable { 14 15 private int itemID; 16 private String name; 17 private String description; 18 private float listPrice; 19 private float unitCost; 20 21 public Item() { } 22 23 @TableGenerator(name="ID_GEN", 24 table="ID_GEN", 25 pkColumnName="GEN_KEY", 26 valueColumnName="GEN_VALUE", 27 pkColumnValue="ITEM_ID", 28 allocationSize=1) 29 @GeneratedValue(strategy=GenerationType.TABLE,generator="ID_GEN") 30 @Id 31 public int getItemID() { 32 return itemID; 33 } 34 35 public String getName() { 36 return name; 37 } 38 39 public String getDescription() { 40 return description; 41 } 42 43 public float getListPrice() { 44 return listPrice; 45 } 46 47 public float getUnitCost() { 48 return unitCost; 49 } 50 public void setItemID(int itemID) { 51 this.itemID = itemID; 52 } 53 public void setName(String name) { 54 this.name = name; 55 } 56 public void setDescription(String description) { 57 this.description = description; 58 } 59 60 public void setListPrice(float listPrice) { 61 this.listPrice = listPrice; 62 } 63 public void setUnitCost(float unitCost) { 64 this.unitCost = unitCost; 65 } 66 } 67 68 69 70 | Popular Tags |