KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xpetstore > domain > Category


1 /*
2  * Created on Feb 22, 2003
3  */

4 package xpetstore.domain;
5
6 import java.io.Serializable JavaDoc;
7
8 import java.util.HashSet JavaDoc;
9 import java.util.Set JavaDoc;
10
11
12 /**
13  * @author <a HREF="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
14  *
15  * @hibernate.class
16  * table="T_CATEGORY"
17  */

18 public class Category
19     implements Serializable JavaDoc
20 {
21     //~ Instance fields --------------------------------------------------------
22

23     private String JavaDoc _categoryId;
24     private String JavaDoc _name;
25     private String JavaDoc _description;
26     private Set JavaDoc _products = new HashSet JavaDoc( );
27
28     //~ Methods ----------------------------------------------------------------
29

30     /**
31      * @return String
32      *
33      * @hibernate.id
34      * generator-class="assigned"
35      * length="10"
36      */

37     public String JavaDoc getCategoryId( )
38     {
39         return _categoryId;
40     }
41
42     /**
43      * @return String
44      *
45      * @hibernate.property
46      * length="255"
47      */

48     public String JavaDoc getDescription( )
49     {
50         return _description;
51     }
52
53     /**
54      * @return String
55      *
56      * @hibernate.property
57      * length="50"
58      */

59     public String JavaDoc getName( )
60     {
61         return _name;
62     }
63
64     /**
65      * @return Set
66      *
67      * @hibernate.set
68      * role="products"
69      * lazy="true"
70      * cascade="delete"
71      * @hibernate.collection-key
72      * column="category_fk"
73      * @hibernate.collection-one-to-many
74      * class="xpetstore.domain.Product"
75      */

76     public Set JavaDoc getProducts( )
77     {
78         return _products;
79     }
80
81     /**
82      * Sets the categoryId.
83      * @param categoryId The categoryId to set
84      */

85     public void setCategoryId( String JavaDoc categoryId )
86     {
87         _categoryId = categoryId;
88     }
89
90     /**
91      * Sets the description.
92      * @param description The description to set
93      */

94     public void setDescription( String JavaDoc description )
95     {
96         _description = description;
97     }
98
99     /**
100      * Sets the name.
101      * @param name The name to set
102      */

103     public void setName( String JavaDoc name )
104     {
105         _name = name;
106     }
107
108     /**
109      * Sets the products.
110      * @param products The products to set
111      */

112     public void setProducts( Set JavaDoc products )
113     {
114         _products = products;
115     }
116 }
117
Popular Tags