com.autentia.tnt.businessobject.Organization.java Source code

Java tutorial

Introduction

Here is the source code for com.autentia.tnt.businessobject.Organization.java

Source

/**
 * TNTConcept Easy Enterprise Management by Autentia Real Bussiness Solution S.L.
 * Copyright (C) 2007 Autentia Real Bussiness Solution S.L.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.autentia.tnt.businessobject;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.autentia.tnt.dao.ITransferObject;
import org.apache.commons.lang.SerializationUtils;

/**
 * Transfer object to store Organizations
 * @author stajanov code generator
 */
public class Organization implements Serializable, ITransferObject {
    /** Serial version field */
    private static final long serialVersionUID = -1L;

    /* organization - generated by stajanov (do not edit/delete) */

    // Fields

    private Integer id;

    private String name;

    private String cif;

    private String street;

    private String number;

    private String locator;

    private String postalCode;

    private String city;

    private String state;

    private String country;

    private String phone;

    private String fax;

    private String email;

    private String website;

    private String ftpsite;

    private String notes;

    private Integer ownerId;

    private Integer departmentId;

    private Date insertDate;

    private Date updateDate;

    private OrganizationType type;

    private OrganizationISOCategory category;

    private EvaluationCriteria evaluationCriteria;

    private Province province;

    private Set<Department> departments = new HashSet<Department>(0);

    private Set<Tag> tags = new HashSet<Tag>(0);

    private Organization changes;

    // Setters and getters

    public Integer getId() {
        return id;
    }

    public EvaluationCriteria getEvaluationCriteria() {
        return evaluationCriteria;
    }

    public void setEvaluationCriteria(EvaluationCriteria evaluationCriteria) {
        this.evaluationCriteria = evaluationCriteria;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Set<Department> getDepartments() {
        return departments;
    }

    public void setDepartments(Set<Department> departments) {
        this.departments = departments;
    }

    public String getName() {
        return name;
    }

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

    public String getCif() {
        return cif;
    }

    public void setCif(String cif) {
        this.cif = cif;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getLocator() {
        return locator;
    }

    public void setLocator(String locator) {
        this.locator = locator;
    }

    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getWebsite() {
        return website;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public String getFtpsite() {
        return ftpsite;
    }

    public void setFtpsite(String ftpsite) {
        this.ftpsite = ftpsite;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Integer getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(Integer ownerId) {
        this.ownerId = ownerId;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public Date getInsertDate() {
        return insertDate;
    }

    public void setInsertDate(Date insertDate) {
        this.insertDate = insertDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public OrganizationType getType() {
        return type;
    }

    public void setType(OrganizationType type) {
        this.type = type;
    }

    public OrganizationISOCategory getCategory() {
        return category;
    }

    public void setCategory(OrganizationISOCategory category) {
        this.category = category;
    }

    public Province getProvince() {
        return province;
    }

    public void setProvince(Province province) {
        this.province = province;
    }

    public Set<Tag> getTags() {
        return tags;
    }

    public void setTags(Set<Tag> tags) {
        this.tags = tags;
    }

    @Override
    public boolean equals(Object that) {
        try {
            if (that == null)
                return false;
            else
                return this.getId().equals(((Organization) that).getId());
        } catch (Exception e) {
            return false;
        }
    }

    @Override
    public int hashCode() {
        if (this.getId() == null)
            return super.hashCode();
        else
            return this.getId().intValue();
    }

    public List<Integer> getOwnersId() {
        // TODO Auto-generated method stub
        return null;
    }

    public Organization getChanges() {
        return changes;
    }

    public void setChanges(Organization changes) {
        this.changes = changes;
    }

    public void initChanges() {
        this.changes = (Organization) SerializationUtils.clone(this);
    }
    /* organization - generated by stajanov (do not edit/delete) */
}