KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > hibernate > Product


1 package test.hibernate;
2
3 import java.math.BigDecimal JavaDoc;
4
5 /**
6  * @hibernate.class
7  * table="PRODUCTS"
8  * discriminator-value="null"
9  * dynamic-update="true"
10  * @hibernate.discriminator
11  * column="PRODUCT_TYPE"
12  * type="string"
13  * length="16"
14  * not-null="false"
15  * @hibernate.jcs-cache
16  * usage="read-only"
17  *
18  * @author Administrator
19  */

20 public class Product extends Persistent implements Updateable {
21     
22     private String JavaDoc description;
23     private String JavaDoc code;
24     private BigDecimal JavaDoc price;
25     private byte[] image;
26     private String JavaDoc updateComment;
27
28     /**
29      * Constructor for Product.
30      */

31     public Product() {
32         super();
33     }
34
35     /**
36      * @hibernate.property
37      * length="512"
38      * @return String
39      */

40     public String JavaDoc getDescription() {
41         return description;
42     }
43
44     /**
45      * Sets the name.
46      * @param name The name to set
47      */

48     public void setDescription(String JavaDoc name) {
49         this.description = name;
50     }
51
52     /**
53      * @hibernate.property
54      * length="16"
55      * unique="true"
56      * update="false"
57      * @return String
58      */

59     public String JavaDoc getCode() {
60         return code;
61     }
62
63     /**
64      * Sets the code.
65      * @param code The code to set
66      */

67     public void setCode(String JavaDoc code) {
68         this.code = code;
69     }
70
71     /**
72      * @hibernate.property
73      * length="4096"
74      * Returns the image.
75      * @return byte[]
76      */

77     public byte[] getImage() {
78         return image;
79     }
80
81     /**
82      * @hibernate.property
83      * Returns the price.
84      * @return BigDecimal
85      */

86     public BigDecimal JavaDoc getPrice() {
87         return price;
88     }
89
90     /**
91      * Sets the image.
92      * @param image The image to set
93      */

94     public void setImage(byte[] image) {
95         this.image = image;
96     }
97
98     /**
99      * Sets the price.
100      * @param price The price to set
101      */

102     public void setPrice(BigDecimal JavaDoc price) {
103         this.price = price;
104     }
105
106     public String JavaDoc getUpdateComment() {
107         return updateComment;
108     }
109
110     public void setUpdateComment(String JavaDoc string) {
111         updateComment = string;
112     }
113
114 }
115
Popular Tags