?? bbsdoc.java
字號:
package com.easyjf.bbs.business;
import java.util.Date;
import java.util.List;
import com.easyjf.dbo.EasyJDB;
import com.easyjf.dbo.IObject;
/**
* BBS文檔信息
* @author 蔡世友
*
*/
public class BBSDoc implements IObject{
// Fields
private String cid;
private String dirSn;
private String parentId;
private String title;
private String content;
private String intro;
private String files;
private String imgs;
private Integer readTimes;
private String tagPic;
private Integer voteScore;
private Integer score;
private String vRType;
private String vRValue;
private String inputUser;
private Date inputTime;
private Date modifyTime;
private String ip;
private String clientInfo;
private Integer good;
private Integer bad;
private String source;
private Integer topMessage;
private Integer eliteMessage;
private Integer status;
//Constructors
public BBSDoc()
{
}
public BBSDoc(String cid)
{
this.cid=cid;
}
// 類的方法
public boolean isTop()
{
return (topMessage!=null && topMessage.intValue()==1);
}
public boolean isElite()
{
return (eliteMessage!=null && eliteMessage.intValue()==1);
}
public boolean isHot()
{
return (readTimes!=null && readTimes.intValue()>500);
}
public boolean isLock()
{
return false;
}
public List children() {
return query("parentId='"+this.cid+"'");
}
public Number replyNum()
{
EasyJDB db=EasyJDB.getInstance();
Number num=(Number)db.uniqueResult("select count(*) from BBSDoc where parentId='"+this.cid+"' and status>=0");
return num;
}
public static BBSDoc read(String cid)
{
EasyJDB db=EasyJDB.getInstance();
return (BBSDoc)db.get(BBSDoc.class,cid);
}
public boolean save()
{
EasyJDB db=EasyJDB.getInstance();
return db.saveOrUpdate(this);
}
public boolean update()
{
EasyJDB db=EasyJDB.getInstance();
return db.update(this);
}
public boolean del()
{
EasyJDB db=EasyJDB.getInstance();
return db.del(this);
}
public static List query(String scope)
{
EasyJDB db=EasyJDB.getInstance();
return db.query(BBSDoc.class,scope);
}
public BBSDoc lastUpdate()
{
EasyJDB db=EasyJDB.getInstance();
BBSDoc reply=(BBSDoc)db.read(BBSDoc.class,"parentId='"+this.cid+"' and status>=0 order by inputTime desc");
if(reply==null)
{
reply=new BBSDoc();
reply.setInputTime(this.inputTime);
reply.setInputUser("--");
}
return reply;
}
public String getKeyField() {
// TODO Auto-generated method stub
return "cid";
}
public String getKeyGenerator() {
// TODO Auto-generated method stub
return "com.easyjf.dbo.IdGenerator";
}
public String getTableName() {
// TODO Auto-generated method stub
return "BBSDoc";
}
//Property accessors
public Integer getBad() {
return bad;
}
public void setBad(Integer bad) {
this.bad = bad;
}
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getClientInfo() {
return clientInfo;
}
public void setClientInfo(String clientInfo) {
this.clientInfo = clientInfo;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getDirSn() {
return dirSn;
}
public void setDirSn(String dirSn) {
this.dirSn = dirSn;
}
public String getFiles() {
return files;
}
public void setFiles(String files) {
this.files = files;
}
public Integer getGood() {
return good;
}
public void setGood(Integer good) {
this.good = good;
}
public String getImgs() {
return imgs;
}
public void setImgs(String imgs) {
this.imgs = imgs;
}
public Date getInputTime() {
return inputTime;
}
public void setInputTime(Date inputTime) {
this.inputTime = inputTime;
}
public String getInputUser() {
return inputUser;
}
public void setInputUser(String inputUser) {
this.inputUser = inputUser;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public Integer getReadTimes() {
return readTimes;
}
public void setReadTimes(Integer readTimes) {
this.readTimes = readTimes;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getTagPic() {
return tagPic;
}
public void setTagPic(String tagPic) {
this.tagPic = tagPic;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getVoteScore() {
return voteScore;
}
public void setVoteScore(Integer voteScore) {
this.voteScore = voteScore;
}
public String getVRType() {
return vRType;
}
public void setVRType(String type) {
vRType = type;
}
public String getVRValue() {
return vRValue;
}
public void setVRValue(String value) {
vRValue = value;
}
public Integer getEliteMessage() {
return eliteMessage;
}
public void setEliteMessage(Integer eliteMessage) {
this.eliteMessage = eliteMessage;
}
public Integer getTopMessage() {
return topMessage;
}
public void setTopMessage(Integer topMessage) {
this.topMessage = topMessage;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -