/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package mydb; import java.io.Serializable; import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.xml.bind.annotation.XmlRootElement; /** * * @author steven */ @Entity @Table(name = "\"IDEAS\"") @XmlRootElement @NamedQueries({ @NamedQuery(name = "Ideas.findAll", query = "SELECT i FROM Ideas i"), @NamedQuery(name = "Ideas.findByIdx", query = "SELECT i FROM Ideas i WHERE i.idx = :idx"), @NamedQuery(name = "Ideas.findByDescription", query = "SELECT i FROM Ideas i WHERE i.description = :description"), @NamedQuery(name = "Ideas.findByCreation", query = "SELECT i FROM Ideas i WHERE i.creation = :creation")}) public class Ideas implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "\"IDX\"") private Integer idx; @Basic(optional = false) @Column(name = "\"DESCRIPTION\"") private String description; @Basic(optional = false) @Column(name = "\"CREATION\"") @Temporal(TemporalType.TIMESTAMP) private Date creation; public Ideas() { } public Ideas(Integer idx) { this.idx = idx; } public Ideas(Integer idx, String description, Date creation) { this.idx = idx; this.description = description; this.creation = creation; } public Integer getIdx() { return idx; } public void setIdx(Integer idx) { this.idx = idx; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Date getCreation() { return creation; } public void setCreation(Date creation) { this.creation = creation; } @Override public int hashCode() { int hash = 0; hash += (idx != null ? idx.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 Ideas)) { return false; } Ideas other = (Ideas) object; if ((this.idx == null && other.idx != null) || (this.idx != null && !this.idx.equals(other.idx))) { return false; } return true; } @Override public String toString() { return "mydb.Ideas[ idx=" + idx + " ]"; } }