?? roles.java
字號:
package entity;
import java.util.ArrayList;
import java.util.List;
import service.DBManager;
/**
* @author myte
*
* 實體類:角色
*/
public class Roles {
private Integer intRoleID;
private String strRName="";
private String setPermissions="";
private Integer intInherat;
private static class RolesDB extends DBManager {
private String tableName="Roles";
private RolesDB() {
}
protected String getTableName() {
return tableName;
}
protected String[] getFields() {
return new String[] { "intRoleID","strRName","setPermissions","intInherat"};
}
protected Object[] getFieldValues(Object o) {
Roles u = (Roles) o;
return new Object[] {u.getIntRoleID(),u.getStrRName(),u.getSetPermissions(),u.getIntInherat()};
}
protected String getKeyFields() {
return KEY_FIELD_NAME;
}
protected Object[] getKeyValues(Object o) {
return new Object[] { ((Roles) o).getIntRoleID() };
}
}
private static final String KEY_FIELD_NAME = "intRoleID";
private static RolesDB entityDB = new RolesDB();
public void insert(){
try {
entityDB.insert(this);
} catch (Exception e) {
e.printStackTrace();
}
}
public void update(){
try {
entityDB.update(this);
} catch (Exception e) {
e.printStackTrace();
}
}
public void delete(){
try {
entityDB.delete(this);
} catch (Exception e) {
e.printStackTrace();
}
}
public List select(String sql){
try {
return entityDB.executeSelect(sql);
} catch (Exception e) {
e.printStackTrace();
}
return new ArrayList();
}
/**
* @return Returns the intInherat.
*/
public Integer getIntInherat() {
return intInherat;
}
/**
* @param intInherat The intInherat to set.
*/
public void setIntInherat(Integer intInherat) {
this.intInherat = intInherat;
}
/**
* @return Returns the intRoleID.
*/
public Integer getIntRoleID() {
return intRoleID;
}
/**
* @param intRoleID The intRoleID to set.
*/
public void setIntRoleID(Integer intRoleID) {
this.intRoleID = intRoleID;
}
/**
* @return Returns the strRName.
*/
public String getStrRName() {
return strRName;
}
/**
* @param strRName The strRName to set.
*/
public void setStrRName(String strRName) {
this.strRName = strRName;
}
/**
* @return Returns the setPermissions.
*/
public String getSetPermissions() {
return setPermissions;
}
/**
* @param setPermissions The setPermissions to set.
*/
public void setSetPermissions(String setPermissions) {
this.setPermissions = setPermissions;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -