/* * 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; import javax.persistence.TableGenerator; import javax.persistence.Transient; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** * * @author metz */ @XmlRootElement @Entity @Table(name = "profile") @NamedQueries({ @NamedQuery(name = "Profile.findAll", query = "SELECT p FROM Profile p"), @NamedQuery(name = "Profile.findById", query = "SELECT p FROM Profile p WHERE p.id = :id"), @NamedQuery(name = "Profile.findByUserId", query = "SELECT p FROM Profile p WHERE p.user_id = :id"), @NamedQuery(name = "Profile.findByHomepage", query = "SELECT p FROM Profile p WHERE p.homepage = :homepage"), @NamedQuery(name = "Profile.findByTwitter", query = "SELECT p FROM Profile p WHERE p.twitter = :twitter"), @NamedQuery(name = "Profile.findByDelicious", query = "SELECT p FROM Profile p WHERE p.delicious = :delicious"), @NamedQuery(name = "Profile.findByMendeley", query = "SELECT p FROM Profile p WHERE p.mendeley = :mendeley")}) public class Profile implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(generator = "ProfileID") @TableGenerator(name="ProfileID", table="id_gen", pkColumnName="ID_NAME", valueColumnName = "ID_VAL", pkColumnValue="LAST_PROFILE", allocationSize=1) @Basic(optional = false) @Column(name = "id") private Long id; @Basic(optional=false) @Column(name = "user_id") private Long user_id; @Transient @XmlElement(name="email") public String email; @Transient @XmlElement(name="firstname") public String firstname; @Transient @XmlElement(name="lastname") public String lastname; @Column(name = "description") private String description; @Column(name = "homepage") private String homepage; @Column(name = "twitter") private String twitter; @Column(name = "delicious") private String delicious; @Column(name = "mendeley") private String mendeley; @Column(name = "skype") private String skype; @Column(name = "msn") private String msn; @Column(name = "blogurl") private String blogurl; @Column(name = "department") private Long department; public Profile() { } public Profile(Long id) { this.id = id; } public Profile(Long id, Long user_id) { this.id = id; this.user_id = user_id; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getUser_id() { return user_id; } public void setUser_id(Long user_id) { this.user_id = user_id; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getHomepage() { return homepage; } public void setHomepage(String homepage) { this.homepage = homepage; } public String getTwitter() { return twitter; } public void setTwitter(String twitter) { this.twitter = twitter; } public String getDelicious() { return delicious; } public void setDelicious(String delicious) { this.delicious = delicious; } public String getMendeley() { return mendeley; } public void setMendeley(String mendeley) { this.mendeley = mendeley; } public String getSkype() { return skype; } public void setSkype(String skype) { this.skype = skype; } public String getMsn() { return msn; } public void setMsn(String msn) { this.msn = msn; } public String getBlogurl() { return blogurl; } public void setBlogurl(String blogurl) { this.blogurl = blogurl; } public Long getDepartment() { return department; } public void setDepartment(Long department) { this.department = department; } @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 Profile)) { return false; } Profile other = (Profile) 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.Profile[id=" + id + "]"; } }