/*
* Ara - Capture Species and Specimen Data
*
* Copyright © 2009 INBio (Instituto Nacional de Biodiversidad).
* Heredia, Costa Rica.
*
* 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, or
* (at your option) any later version.
*
* 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 org.inbio.ara.persistence.institution;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.inbio.ara.persistence.GenericEntity;
/**
*
* @author herson
*/
@Entity
@Table(name = "institution")
public class Institution extends GenericEntity {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO, generator="Institution")
@SequenceGenerator(name="Institution", sequenceName="institution_seq")
@Basic(optional = false)
@Column(name = "institution_id")
private Long institutionId;
@Basic(optional = false)
@Column(name = "institution_code")
private String institutionCode;
@Basic(optional = false)
@Column(name = "name")
private String name;
@Column(name = "telephone")
private String telephone;
@Column(name = "fax")
private String fax;
@Column(name = "street_address")
private String streetAddress;
@Column(name = "city")
private String city;
@Column(name = "state_province")
private String stateProvince;
@Column(name = "country")
private String country;
@Column(name = "acronym")
private String acronym;
@Column(name = "url")
private String url;
@Column(name = "multimedia_id")
private Long multimediaId;
public Institution() {
}
public Institution(Long institutionId) {
this.institutionId = institutionId;
}
public Institution(Long institutionId, String institutionCode, String name) {
this.institutionId = institutionId;
this.institutionCode = institutionCode;
this.name = name;
// this.objVersion = objVersion;
}
public Long getInstitutionId() {
return institutionId;
}
public void setInstitutionId(Long institutionId) {
this.institutionId = institutionId;
}
public String getInstitutionCode() {
return institutionCode;
}
public void setInstitutionCode(String institutionCode) {
this.institutionCode = institutionCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getStreetAddress() {
return streetAddress;
}
public void setStreetAddress(String streetAddress) {
this.streetAddress = streetAddress;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getStateProvince() {
return stateProvince;
}
public void setStateProvince(String stateProvince) {
this.stateProvince = stateProvince;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getAcronym() {
return acronym;
}
public void setAcronym(String acronym) {
this.acronym = acronym;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Long getMultimediaId() {
return multimediaId;
}
public void setMultimediaId(Long multimediaId) {
this.multimediaId = multimediaId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (institutionId != null ? institutionId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Institution)) {
return false;
}
Institution other = (Institution) object;
if ((this.institutionId == null && other.institutionId != null) || (this.institutionId != null && !this.institutionId.equals(other.institutionId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "org.inbio.ara.persistence.institution.Institution[institutionId=" + institutionId + "]";
}
}