/**
* 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 org.apache.commons.lang.SerializationUtils;
import com.autentia.tnt.dao.ITransferObject;
public class Position implements Serializable, ITransferObject {
/* Position - generated by stajanov (do not edit/delete) */
// Fields
private Integer id;
private Integer ownerId;
private Integer departmentId;
private String name;
private String description;
private Date insertDate;
private Date updateDate;
private Date deleteDate;
private Set<Department> departments = new HashSet<Department>(0);
private Set<Tag> tags = new HashSet<Tag>(0);
private Set<Integer> tagsId = new HashSet<Integer>(0);
private Position changes;
private Set<PositionChange> history = new HashSet<PositionChange>();
private String email;
private String phone;
private String fax;
private String country;
private String postalCode;
private String address;
private String city;
private Province province;
// Setters and getters
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
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 getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public Province getProvince() {
return province;
}
public void setProvince(Province province) {
this.province = province;
}
public Integer getId() {
return id;
}
private void setId(Integer id) {
this.id = id;
}
public Set<Department> getDepartments() {
return departments;
}
public void setDepartments(Set<Department> departments) {
this.departments = departments;
}
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 String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
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 Date getDeleteDate() {
return deleteDate;
}
public void setDeleteDate(Date deleteDate) {
this.deleteDate = deleteDate;
}
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(((Position)that).getId());
} catch (Exception e) {
return false;
}
}
@Override
public int hashCode() {
if (this.getId() == null)
return super.hashCode();
else
return this.getId().intValue();
}
public boolean isDeleted() {
return this.getDeleteDate() != null;
}
public Set<PositionChange> getHistory() {
return history;
}
public void setHistory(Set<PositionChange> history) {
this.history = history;
}
public void initChanges() {
// recorremos las relaciones mĂșltiples para que se copien en el clon
// los objetos y no los proxies de HB
// accedemos a una propiedad de cada para segurarnos que se carga el obj
if (this.getProvince() != null) {
this.getProvince().getId();
this.getProvince().getName();
}
for (Tag tag : this.getTags()) {
tag.getId();
}
this.changes = (Position)SerializationUtils.clone(this);
}
public Position getChanges() {
return changes;
}
public void setChanges(Position changes) {
this.changes = changes;
}
public Set<Integer> getTagsId() {
return tagsId;
}
public void setTagsId(Set<Integer> tagsId) {
this.tagsId = tagsId;
}
public List<Integer> getOwnersId() {
// TODO Auto-generated method stub
return null;
}
/* Position - generated by stajanov (do not edit/delete) */
}