📄 userinfo.java
字号:
/*
* UserInfo.java
*
* Created on 2008年11月4日, 下午5:08
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package newpackage;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* 实体类 UserInfo
*
* @author Administrator
*/
@Entity
public class UserInfo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String username;
private String password;
/** Creates a new instance of UserInfo */
public UserInfo() {
}
/**
* 获取此 UserInfo 的 id。
* @return id
*/
public Long getId() {
return this.id;
}
/**
* 将此 UserInfo 的 id 设置为指定的值。
* @param id,新建 id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 返回对象的散列代码值。该实现根据此对象
* 中 id 字段计算散列代码值。
* @return 此对象的散列代码值。
*/
/*@Override
public int hashCode() {
int hash = 0;
hash += (this.id != null ? this.id.hashCode() : 0);
return hash;
}*/
public String getName(){
return username;
}
public void setName(String username){
this.username=username;
}
public String getPassword(){
return password;
}
public void setPassword(String password){
this.password=password;
}
/**
* 确定其他对象是否等于此 UserInfo。当且仅当
* 参数不为 null 且该参数是具有与此对象相同 id 字段值的 UserInfo 对象时,
* 结果才为 <code>true</code>。
* @param 对象,要比较的引用对象
* 如果此对象与参数相同,则 @return <code>true</code>;
* 否则为 <code>false</code>。
*/
/*@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 UserInfo)) {
return false;
}
UserInfo other = (UserInfo)object;
if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
return true;
}*/
/**
* 返回对象的字符串表示法。该实现根据 id 字段
* 构造此表示法。
* @return 对象的字符串表示法。
*/
/*@Override
public String toString() {
return "newpackage.UserInfo[id=" + id + "]";
}*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -