Category.java :  » Groupware » coefficient » za » org » coefficient » core » Java Open Source

Java Open Source » Groupware » coefficient 
coefficient » za » org » coefficient » core » Category.java
/*
 * Coefficient - facilitates project based collaboration
 * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
 * PO Box 395
 * Pretoria 0001, RSA
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package za.org.coefficient.core;


/**
 * Title:        Project Engine
 * Description:
 * Copyright:    Copyright (c) 2003
 * Company:      icomtek CSIR
 * @author Krishendran Rangappa
 * @version 1.0
 * @hibernate.class
 *  table="COEFFICIENT_CATEGORY"
 */
public class Category implements java.io.Serializable {
    //~ Instance fields ========================================================

    private Category parentCategory;
    private Long id;
    private String description;
    private String name;
    private long version;

    //~ Constructors ===========================================================

    public Category() {
        name = ".";
    }

    //~ Methods ================================================================

    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @hibernate.property
     *  column="DESCRIPTION"
     *  length="3999"
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of id
     *
     * @param argId Value to assign to this.id
     */
    public void setId(Long argId) {
        this.id = argId;
    }

    /**
     * Gets the value of id
     *
     * @return the value of id
     * @hibernate.id
     *  generator-class="native"
     */
    public Long getId() {
        return this.id;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * @hibernate.property
     *  column="NAME"
     */
    public String getName() {
        return name;
    }

    public void setParentCategory(Category parentCategory) {
        this.parentCategory = parentCategory;
    }

    /**
     * @hibernate.many-to-one
     *   column="PARENT_CATEGORY"
     */
    public Category getParentCategory() {
        return parentCategory;
    }

    /**
     * Sets the value of version
     *
     * @param version Value to assign to this.version
     */
    public void setVersion(long version) {
        this.version = version;
    }

    /**
     * Gets the value of version
     *
     * @return the value of version
     * @hibernate.version
     *   column="VERSION"
     *   type="long"
     */
    public long getVersion() {
        return this.version;
    }

    public boolean equals(Object other) {
        Category o = (Category) other;

        return (this != null) && (o != null)
        && (this.toString().equals(o.toString()));
    }

    public String toString() {
        return ((parentCategory == null) ? ""
                                         : (parentCategory.toString() + "/"
        + name));
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.