日期:2014-05-19 浏览次数:20651 次
/**
* 统一定义id的entity基类.
* @author MingDao
*/
// JPA基类标识
@MappedSuperclass
public abstract class IdEntity
{
protected Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
}
/**
* 系统用户实体
*/
@Entity
@Table(name = "SYS_USER")
public class User extends IdEntity
{
private String name;
private String account;
private String password;
@Column(name = "USER_NAME")
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
@Column(name = "USER_ACCOUNT")
public String getAccount()
{
return account;
}
public void setAccount(String account)
{
this.account = account;
}
@Column(name = "USER_PASSWORD")
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
}
/**
* 客户类型实体类
*/
@Entity
@Table(name="HHS_CLIENTTYPE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ClientType extends IdEntity implements Serializable
{
private static final long serialVersionUID = 4005802016130232896L;
private String clntpCode; //客户类别编码
private String clntpName; //客户类别名称
@Id
@Column(name="CLNTP_ID")
@Override
public Long getId()
{
return super.getId();
}
@Column(name="CLNTP_CODE")
public String getClntpCode()
{
return clntpCode;
}
public void setClntpCode(String clntpCode)
{
this.clntpCode = clntpCode;
}
@Column(name="CLNTP_NAME")
public String getClntpName()
{
return clntpName;
}
public void setClntpName(String clntpName)
{
this.clntpName = clntpName;
}
}