001: /*
002: * Coefficient - facilitates project based collaboration
003: * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
004: * PO Box 395
005: * Pretoria 0001, RSA
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019:
020: package za.org.coefficient.core;
021:
022: /**
023: * Title: Project Engine
024: * Description:
025: * Copyright: Copyright (c) 2003
026: * Company: icomtek CSIR
027: * @author Krishendran Rangappa
028: * @version 1.0
029: * @hibernate.class
030: * table="COEFFICIENT_CATEGORY"
031: */
032: public class Category implements java.io.Serializable {
033: //~ Instance fields ========================================================
034:
035: private Category parentCategory;
036: private Long id;
037: private String description;
038: private String name;
039: private long version;
040:
041: //~ Constructors ===========================================================
042:
043: public Category() {
044: name = ".";
045: }
046:
047: //~ Methods ================================================================
048:
049: public void setDescription(String description) {
050: this .description = description;
051: }
052:
053: /**
054: * @hibernate.property
055: * column="DESCRIPTION"
056: * length="3999"
057: */
058: public String getDescription() {
059: return description;
060: }
061:
062: /**
063: * Sets the value of id
064: *
065: * @param argId Value to assign to this.id
066: */
067: public void setId(Long argId) {
068: this .id = argId;
069: }
070:
071: /**
072: * Gets the value of id
073: *
074: * @return the value of id
075: * @hibernate.id
076: * generator-class="native"
077: */
078: public Long getId() {
079: return this .id;
080: }
081:
082: public void setName(String name) {
083: this .name = name;
084: }
085:
086: /**
087: * @hibernate.property
088: * column="NAME"
089: */
090: public String getName() {
091: return name;
092: }
093:
094: public void setParentCategory(Category parentCategory) {
095: this .parentCategory = parentCategory;
096: }
097:
098: /**
099: * @hibernate.many-to-one
100: * column="PARENT_CATEGORY"
101: */
102: public Category getParentCategory() {
103: return parentCategory;
104: }
105:
106: /**
107: * Sets the value of version
108: *
109: * @param version Value to assign to this.version
110: */
111: public void setVersion(long version) {
112: this .version = version;
113: }
114:
115: /**
116: * Gets the value of version
117: *
118: * @return the value of version
119: * @hibernate.version
120: * column="VERSION"
121: * type="long"
122: */
123: public long getVersion() {
124: return this .version;
125: }
126:
127: public boolean equals(Object other) {
128: Category o = (Category) other;
129:
130: return (this != null) && (o != null)
131: && (this .toString().equals(o.toString()));
132: }
133:
134: public String toString() {
135: return ((parentCategory == null) ? "" : (parentCategory
136: .toString()
137: + "/" + name));
138: }
139: }
|