package com.zhc.jpa.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.HashCodeBuilder;

@Entity
@Table(name="t_user")
public class SysUser implements Serializable {

	private static final long serialVersionUID = -6197880310898379895L;

	private Integer id;
	private String account;
	private String password;
	
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(length=25,nullable=false,unique=true)
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	
	@Column(length=25,nullable=false)
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public SysUser(){}
	
	public SysUser(String account, String password) {
		
		this.account = account;
		this.password = password;
	}
	@Override
	public int hashCode() {
		final int PRIME = 31;
	    return new HashCodeBuilder(getId()%2==0?getId()+1:getId(), PRIME).
	           toHashCode();
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SysUser other = (SysUser) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
	
}
最近下载更多
guaixia163  LV13 2023年1月12日
aa123456awww  LV8 2019年11月23日
元芳你怎么看  LV15 2019年9月19日
ZiruiSong  LV7 2019年7月31日
Schikki  LV1 2018年12月4日
chrisgong  LV1 2018年7月20日
pcxcz123  LV6 2018年5月21日
咸蛋超人_92  LV1 2018年5月10日
erickingxl  LV2 2018年4月25日
hwajl3656  LV1 2018年4月23日
最近浏览更多
guaixia163  LV13 2023年1月12日
13165798872  LV11 2022年5月17日
fengshengtian  LV8 2022年2月26日
CrystalQ  LV8 2021年11月20日
余不二  LV2 2021年11月19日
dongliuxi  LV3 2021年10月26日
wangxiaolaugh  LV2 2021年9月30日
东方星空  LV1 2021年8月6日
洛神赋 2021年4月3日
暂无贡献等级
939867966  LV1 2021年2月25日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友