/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ee.tlu.htk.dippler.entities; import java.io.Serializable; 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.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; /** * * @author metz */ @Entity @Table(name = "dictionary") @NamedQueries({ @NamedQuery(name = "Dictionary.findAll", query = "SELECT d FROM Dictionary d"), @NamedQuery(name = "Dictionary.findById", query = "SELECT d FROM Dictionary d WHERE d.id = :id"), @NamedQuery(name = "Dictionary.findByWord", query = "SELECT d FROM Dictionary d WHERE d.word = :word"), @NamedQuery(name = "Dictionary.findByCategory", query = "SELECT d FROM Dictionary d WHERE d.category = :category"), @NamedQuery(name = "Dictionary.findByLanguage", query = "SELECT d FROM Dictionary d WHERE d.language = :language"), @NamedQuery(name = "Dictionary.findBySelected", query = "SELECT d FROM Dictionary d WHERE d.selected = :selected")}) public class Dictionary implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id") private Long id; @Basic(optional = false) @Column(name = "word") private String word; @Basic(optional = false) @Column(name = "category") private String category; @Column(name = "language") private String language; @Column(name = "selected") private Boolean selected; public Dictionary() { } public Dictionary(Long id) { this.id = id; } public Dictionary(Long id, String word, String category) { this.id = id; this.word = word; this.category = category; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getWord() { return word; } public void setWord(String word) { this.word = word; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } public Boolean getSelected() { return selected; } public void setSelected(Boolean selected) { this.selected = selected; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.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 Dictionary)) { return false; } Dictionary other = (Dictionary) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "ee.tlu.htk.dippler.entities.Dictionary[id=" + id + "]"; } }