/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.inbio.ara.persistence.germplasm; import java.io.Serializable; import java.util.Calendar; import java.util.Collection; import java.util.Date; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.inbio.ara.persistence.LogGenericEntity; import org.inbio.ara.persistence.taxonomy.Taxon; /** * * @author dasolano */ @Entity @Table(name = "breed") public class Breed extends LogGenericEntity { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.AUTO, generator="breed") @SequenceGenerator(name="breed", sequenceName="breed_seq") @Basic(optional = false) @Column(name = "breed_id") private Long breedId; @Basic(optional = false) @Column(name = "name") private String name; @Basic(optional = false) @Column(name = "taxon_id") private Long taxonId; public Breed() { } public Breed(Long breedId) { this.breedId = breedId; } public Breed(Long breedId, String name, String createdBy, Calendar creationDate, String lastModificationBy, Calendar lastModificationDate) { this.breedId = breedId; this.name = name; this.setCreatedBy(createdBy); this.setCreationDate(creationDate); this.setLastModificationBy(lastModificationBy); this.setLastModificationDate(lastModificationDate); } public Long getBreedId() { return breedId; } public void setBreedId(Long breedId) { this.breedId = breedId; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public int hashCode() { int hash = 0; hash += (breedId != null ? breedId.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 Breed)) { return false; } Breed other = (Breed) object; if ((this.breedId == null && other.breedId != null) || (this.breedId != null && !this.breedId.equals(other.breedId))) { return false; } return true; } @Override public String toString() { return "org.inbio.ara.persistence.germplasm.Breed[breedId=" + breedId + "]"; } /** * @return the taxonId */ public Long getTaxonId() { return taxonId; } /** * @param taxonId the taxonId to set */ public void setTaxonId(Long taxonId) { this.taxonId = taxonId; } }