KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > johnmammen > betterpetshop > bo > Product


1 package johnmammen.betterpetshop.bo;
2
3 import java.io.Serializable JavaDoc;
4 import org.apache.commons.lang.builder.ToStringBuilder;
5 import org.apache.tapestry.pets.domain.model.*;
6
7
8 /**
9  * @hibernate.class
10  * table="product"
11  *
12 */

13 public class Product implements Serializable JavaDoc, IProduct {
14
15     /** identifier field */
16     private String JavaDoc productid;
17
18     /** nullable persistent field */
19     private String JavaDoc image;
20
21     /** nullable persistent field */
22     private johnmammen.betterpetshop.bo.Productdetail productdetail;
23
24     /** persistent field */
25     private johnmammen.betterpetshop.bo.Categorydetail categorydetail;
26
27     /** full constructor */
28     public Product(String JavaDoc productid, String JavaDoc image, johnmammen.betterpetshop.bo.Productdetail productdetail, johnmammen.betterpetshop.bo.Categorydetail categorydetail) {
29         this.productid = productid;
30         this.image = image;
31         this.productdetail = productdetail;
32         this.categorydetail = categorydetail;
33     }
34
35     /** default constructor */
36     public Product() {
37     }
38
39     /** minimal constructor */
40     public Product(String JavaDoc productid, johnmammen.betterpetshop.bo.Categorydetail categorydetail) {
41         this.productid = productid;
42         this.categorydetail = categorydetail;
43     }
44
45     /**
46      * @hibernate.id
47      * generator-class="assigned"
48      * type="java.lang.String"
49      * column="productid"
50      *
51      */

52     public String JavaDoc getProductid() {
53         return this.productid;
54     }
55
56     public void setProductid(String JavaDoc productid) {
57         this.productid = productid;
58     }
59
60     /**
61      * @hibernate.property
62      * column="image"
63      * length="255"
64      *
65      */

66     public String JavaDoc getImage() {
67         return this.image;
68     }
69
70     public void setImage(String JavaDoc image) {
71         this.image = image;
72     }
73
74     /**
75      * @hibernate.one-to-one
76      * outer-join="auto"
77      *
78      */

79     public johnmammen.betterpetshop.bo.Productdetail getProductdetail() {
80         return this.productdetail;
81     }
82
83     public void setProductdetail(johnmammen.betterpetshop.bo.Productdetail productdetail) {
84         this.productdetail = productdetail;
85     }
86
87     /**
88      * @hibernate.many-to-one
89      * not-null="true"
90      * @hibernate.column name="catid"
91      *
92      */

93     public johnmammen.betterpetshop.bo.Categorydetail getCategorydetail() {
94         return this.categorydetail;
95     }
96
97     public void setCategorydetail(johnmammen.betterpetshop.bo.Categorydetail categorydetail) {
98         this.categorydetail = categorydetail;
99     }
100
101     public String JavaDoc toString() {
102         return new ToStringBuilder(this)
103             .append("productid", getProductid())
104             .toString();
105     }
106
107 }
108
Popular Tags