/* * TestEntity.java * * Created on 28. September 2006, 13:13 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package test; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; /** * * @author ulim */ @Entity @Table(name = "TESTENTITY") public class TestEntity implements Serializable { @Id private Long id; @Column(name = "PASSWORD") private String password; /** Creates a new instance of TestEntity */ public TestEntity() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPassword() { System.out.println("Returning /" + this.password + "/ as password."); return this.password; } public void setPassword(String pw) { System.out.println("Setting /" + pw + "/ as password."); this.password = pw; } public int hashCode() { int hash = 0; hash += (this.id != null ? this.id.hashCode() : 0); return hash; } public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof TestEntity)) { return false; } TestEntity other = (TestEntity)object; if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false; return true; } public String toString() { return "test.TestEntity[id=" + id + "]"; } }