@Entity
@Table(name="tabla_persona")
public class Persona implements Serializable {
/**
*
*/
private static final long serialVersionUID = 144585071807476496L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
@Column(name="columna_name", nullable=false, length=45)
private String name;
@Column(name="columna_email", nullable=false, length=45)
private String email;
@Column(name="columna_website", nullable=true, length=45)
private String website;
@Lob
@Column(name="columna_message", nullable=false)
private String message;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getWebsite() {
return website;
}
public void setWebsite(String website) {
this.website = website;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((message == null) ? 0 : message.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((website == null) ? 0 : website.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Persona other = (Persona) obj;
if (email == null) {
if (other.email != null)
return false;
} else if (!email.equals(other.email))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (message == null) {
if (other.message != null)
return false;
} else if (!message.equals(other.message))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (website == null) {
if (other.website != null)
return false;
} else if (!website.equals(other.website))
return false;
return true;
}
}