KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > javaee > blueprints > autoid > model > Item


1 /*
2  * Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at:
3  * http://developer.sun.com/berkeley_license.html
4  * $Id: Item.java,v 1.1 2006/06/21 01:12:06 inder Exp $
5  */

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 JavaDoc {
14     
15     private int itemID;
16     private String JavaDoc name;
17     private String JavaDoc 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 JavaDoc getName() {
36         return name;
37     }
38     
39     public String JavaDoc 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 JavaDoc name) {
54         this.name = name;
55     }
56     public void setDescription(String JavaDoc 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