📄 author.java
字号:
package com.weblog.model;
// Writed 2006-5-25 13:30:27 by 37signals.cn
/**
* @struts.form include-all="true" extends="BaseForm"
* @hibernate.class table="author"
*
*/
public class Author extends com.weblog.model.BaseObject implements
java.io.Serializable {
//字段
private Long id;
private String name;
private String password;
// Constructors
/** 缺省构造器 */
public Author() {
}
/** 完整构造器 **/
public Author(String name, String password) {
this.name = name;
this.password = password;
}
//属性访问
/**
* *
*
* @hibernate.id generator-class="native" type="java.lang.Integer"
* column="ID"
*
*/
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
/**
* *
*
* @hibernate.property column="NAME" length="50"
*
*/
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
/**
* *
*
* @hibernate.property column="PASSWORD" length="20"
*
*/
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
/**
* toString
*
* @return String
*/
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(getClass().getName()).append("@").append(
Integer.toHexString(hashCode())).append(" [");
buffer.append("name").append("='").append(getName()).append("' ");
buffer.append("password").append("='").append(getPassword()).append(
"' ");
buffer.append("]");
return buffer.toString();
}
public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof Author))
return false;
Author castOther = (Author) other;
return ((this.getId() == castOther.getId()) || (this.getId() != null
&& castOther.getId() != null && this.getId().equals(
castOther.getId())))
&& ((this.getName() == castOther.getName()) || (this.getName() != null
&& castOther.getName() != null && this.getName()
.equals(castOther.getName())))
&& ((this.getPassword() == castOther.getPassword()) || (this
.getPassword() != null
&& castOther.getPassword() != null && this
.getPassword().equals(castOther.getPassword())));
}
public int hashCode() {
int result = 17;
result = 37 * result + (getId() == null ? 0 : this.getId().hashCode());
result = 37 * result
+ (getName() == null ? 0 : this.getName().hashCode());
result = 37 * result
+ (getPassword() == null ? 0 : this.getPassword().hashCode());
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -