KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > core > Category


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package za.org.coefficient.core;
21
22
23 /**
24  * Title: Project Engine
25  * Description:
26  * Copyright: Copyright (c) 2003
27  * Company: icomtek CSIR
28  * @author Krishendran Rangappa
29  * @version 1.0
30  * @hibernate.class
31  * table="COEFFICIENT_CATEGORY"
32  */

33 public class Category implements java.io.Serializable JavaDoc {
34     //~ Instance fields ========================================================
35

36     private Category parentCategory;
37     private Long JavaDoc id;
38     private String JavaDoc description;
39     private String JavaDoc name;
40     private long version;
41
42     //~ Constructors ===========================================================
43

44     public Category() {
45         name = ".";
46     }
47
48     //~ Methods ================================================================
49

50     public void setDescription(String JavaDoc description) {
51         this.description = description;
52     }
53
54     /**
55      * @hibernate.property
56      * column="DESCRIPTION"
57      * length="3999"
58      */

59     public String JavaDoc getDescription() {
60         return description;
61     }
62
63     /**
64      * Sets the value of id
65      *
66      * @param argId Value to assign to this.id
67      */

68     public void setId(Long JavaDoc argId) {
69         this.id = argId;
70     }
71
72     /**
73      * Gets the value of id
74      *
75      * @return the value of id
76      * @hibernate.id
77      * generator-class="native"
78      */

79     public Long JavaDoc getId() {
80         return this.id;
81     }
82
83     public void setName(String JavaDoc name) {
84         this.name = name;
85     }
86
87     /**
88      * @hibernate.property
89      * column="NAME"
90      */

91     public String JavaDoc getName() {
92         return name;
93     }
94
95     public void setParentCategory(Category parentCategory) {
96         this.parentCategory = parentCategory;
97     }
98
99     /**
100      * @hibernate.many-to-one
101      * column="PARENT_CATEGORY"
102      */

103     public Category getParentCategory() {
104         return parentCategory;
105     }
106
107     /**
108      * Sets the value of version
109      *
110      * @param version Value to assign to this.version
111      */

112     public void setVersion(long version) {
113         this.version = version;
114     }
115
116     /**
117      * Gets the value of version
118      *
119      * @return the value of version
120      * @hibernate.version
121      * column="VERSION"
122      * type="long"
123      */

124     public long getVersion() {
125         return this.version;
126     }
127
128     public boolean equals(Object JavaDoc other) {
129         Category o = (Category) other;
130
131         return (this != null) && (o != null)
132         && (this.toString().equals(o.toString()));
133     }
134
135     public String JavaDoc toString() {
136         return ((parentCategory == null) ? ""
137                                          : (parentCategory.toString() + "/"
138         + name));
139     }
140 }
141
Popular Tags