⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webmessage.java

📁 简易java框架开源论坛系统,简 易java框架开源论坛系统
💻 JAVA
字号:
package com.easyjf.bbs.business;

import java.util.Date;
import java.util.List;

import com.easyjf.dbo.EasyJDB;
import com.easyjf.dbo.IObject;

public class WebMessage implements IObject {

	public static final int NORMAL = 0;

	public static final int SENDDEL = 1;

	public static final int REVDEL = 5;

	public static final int NORMALMSG = 0;

	public static final int SYSTEMMSG = 1;

	public static final int SYSTEMSENDMSG = 5;

	public static final int READ = 1;

	public static final int UNREAD = 0;

	public static final String WELCOMEMSG = "welcome";

	public static final String FRIENDREQMSG = "friend";

	public static final String ACKMSG = "ack";

	private String cid;

	private String fromname;

	private String toname;

	private String title;

	private String message;

	private Date senddate;

	private Date readdate;

	private Integer status;

	private Integer type;

	private Integer isRead;

	private Integer ACK;

	public Integer getACK() {
		return ACK;
	}

	public void setACK(Integer ack) {
		ACK = ack;
	}

	public Integer getIsRead() {
		return isRead;
	}

	public void setIsRead(Integer isRead) {
		this.isRead = isRead;
	}

	public static WebMessage read(String cid) {
		return (WebMessage) EasyJDB.getInstance().read(WebMessage.class,
				"cid='" + cid + "'");
	}

	public static List query(String scope) {
		return EasyJDB.getInstance().query(WebMessage.class, scope);
	}

	public static Number UnReadNum(String toname) {
		EasyJDB db = EasyJDB.getInstance();
		Number num = (Number) db
				.uniqueResult("select count(*) from webmessage where toname='"
						+ toname + "' and isread=" + UNREAD
						+ " and status in (" + NORMAL + " , " + SENDDEL
						+ ") and type in (" + NORMALMSG + " , " + SYSTEMSENDMSG
						+ ")");
		return num;
	}

	public boolean save() {
		return EasyJDB.getInstance().add(this);
	}

	public boolean del() {
		return EasyJDB.getInstance().del(this);
	}

	public boolean update() {
		return EasyJDB.getInstance().update(this);
	}

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getFromname() {
		return fromname;
	}

	public void setFromname(String fromname) {
		this.fromname = fromname;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Date getReaddate() {
		return readdate;
	}

	public void setReaddate(Date readdate) {
		this.readdate = readdate;
	}

	public Date getSenddate() {
		return senddate;
	}

	public void setSenddate(Date senddate) {
		this.senddate = senddate;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getToname() {
		return toname;
	}

	public void setToname(String toname) {
		this.toname = toname;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public WebMessage() {
		super();
		// TODO Auto-generated constructor stub
	}

	public String getTableName() {
		// TODO Auto-generated method stub
		return "webmessage";
	}

	public String getKeyField() {
		// TODO Auto-generated method stub
		return "cid";
	}

	public String getKeyGenerator() {
		// TODO Auto-generated method stub
		return "com.easyjf.dbo.IdGenerator";
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -