systemprivilege.java
来自「巴巴运动网源码 传智博客出品 不全 一部分代码 可以参考」· Java 代码 · 共 70 行
JAVA
70 行
package com.itcast.bean.privilege;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
@Entity
public class SystemPrivilege implements Serializable{
private SystemPrivilegePK id;
private String name;//权限名称
public SystemPrivilege(){}
public SystemPrivilege(SystemPrivilegePK id) {
this.id = id;
}
public SystemPrivilege(SystemPrivilegePK id, String name) {
this.id = id;
this.name = name;
}
public SystemPrivilege(String model, String privilegeValue, String name) {
this.id = new SystemPrivilegePK(model, privilegeValue);
this.name = name;
}
@EmbeddedId
public SystemPrivilegePK getId() {
return id;
}
public void setId(SystemPrivilegePK id) {
this.id = id;
}
@Column(length=30,nullable=false)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.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;
final SystemPrivilege other = (SystemPrivilege) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?