?? permission.java
字號:
package entity;
import java.util.ArrayList;
import java.util.List;
import service.DBManager;
/**
* @author myte
*
* 實體類:權限
*/
public class Permission {
private Integer intPID;
private String strPName="";
private Integer intResID;
private String setOperation="";
private Integer intIsAnonymous;
private static class PermissionDB extends DBManager {
private String tableName="Permission";
private PermissionDB() {
}
protected String getTableName() {
return tableName;
}
protected String[] getFields() {
return new String[] { "intPID", "strPName",
"intResID", "setOperation", "intIsAnonymous"};
}
protected Object[] getFieldValues(Object o) {
Permission u = (Permission) o;
return new Object[] {u.getIntPID(),u.getStrPName(),u.getIntResID()
,u.getSetOperation(),u.getIntIsAnonymous()};
}
protected String getKeyFields() {
return KEY_FIELD_NAME;
}
protected Object[] getKeyValues(Object o) {
return new Object[] { ((Permission) o).getIntPID() };
}
}
private static final String KEY_FIELD_NAME = "intPID";
private static PermissionDB entityDB = new PermissionDB();
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 intIsAnonymous.
*/
public Integer getIntIsAnonymous() {
return intIsAnonymous;
}
/**
* @param intIsAnonymous The intIsAnonymous to set.
*/
public void setIntIsAnonymous(Integer intIsAnonymous) {
this.intIsAnonymous = intIsAnonymous;
}
/**
* @return Returns the intPID.
*/
public Integer getIntPID() {
return intPID;
}
/**
* @param intPID The intPID to set.
*/
public void setIntPID(Integer intPID) {
this.intPID = intPID;
}
/**
* @return Returns the intResID.
*/
public Integer getIntResID() {
return intResID;
}
/**
* @param intResID The intResID to set.
*/
public void setIntResID(Integer intResID) {
this.intResID = intResID;
}
/**
* @return Returns the setOperation.
*/
public String getSetOperation() {
return setOperation;
}
/**
* @param setOperation The setOperation to set.
*/
public void setSetOperation(String setOperation) {
this.setOperation = setOperation;
}
/**
* @return Returns the strPName.
*/
public String getStrPName() {
return strPName;
}
/**
* @param strPName The strPName to set.
*/
public void setStrPName(String strPName) {
this.strPName = strPName;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -