📄 bo.java~11~
字号:
package com.ksgl.system.message_answers;
import java.util.*;
import com.core.web.Paging;
import com.core.persistence.PersistenceManager;
import com.core.persistence.TransactionPM;
import com.core.web.*;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import com.core.business.SequenceMng;
import org.apache.commons.beanutils.BeanUtils;
import com.ksgl.map.*;
import com.opensymphony.xwork.ActionContext;
/**
* <p>Title: 文字信息BO类</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: 新闻信息</p>
* @author hj
* @version 1.0
*/
public class BO {
private static Log log = LogFactory.getLog(BO.class);
PersistenceManager pm = new PersistenceManager();
TransactionPM tm = new TransactionPM();
public BO() {
}
/**
* add
* */
public void add(Message objmap) {
log.info("22222222222222222222222="+objmap.getMessageid());
log.info("111111111111111111111111="+objmap.getAnswer());
log.info("33333333333333333333333="+objmap.getUpdatetime());
log.info("44444444444444444444444="+objmap.getUserid());
try {
objmap.setId(new SequenceMng().getSequence("Message", "留言板信息"));
// objmap.setHj("0");
// new com.core.log.RecLog().add(((com.ksgl.map.T_sys_gly)ActionContext.getContext().get("user")).getBm(),"信息增加操作,id:"+objmap.getId());
pm.saveObj(objmap);
}
catch (Exception ex) {
log.error("添加add Message出错!");
ex.printStackTrace();
}
}
/**
* turn page
*/
public List queryList(Paging paging, Condition condition) {
List ret = null;
String hql = " from Message where 1=1";
if (!condition.getCondition().equals("")) {
hql += " " + condition.getCondition();
}
hql = hql + " order by updatetime DESC";
try {
ret = pm.queryPageObjs(hql, paging);
}
catch (Exception e) {
log.error("查询queryLbList Message出错!");
e.printStackTrace();
}
return ret;
}
/**
* no turn page query
*/
public List queryList(Condition condition) {
List ret = null;
String hql = " from Message_answers where 1=1";
if (!condition.getCondition().equals("")) {
hql += " " + condition.getCondition();
}
hql = hql + " order by updatetime DESC";
try {
ret = pm.queryObjs(hql);
}
catch (Exception e) {
log.error("查询queryList Message出错!");
e.printStackTrace();
}
return ret;
}
/**
* query one
* */
public Message_answers queryList1(String id) {
List ret = null;
Message_answers Message_answers = new Message_answers();
String hql = " from Message_answers where id='" + id + "'";
try {
ret = pm.queryObjs(hql);
Message_answers = (Message_answers) ret.get(0);
}
catch (Exception e) {
log.error("查询id = " + id + " queryList1 Message出错!");
e.printStackTrace();
}
return Message_answers;
}
/**
* update one
* */
public void update(Message_answers objmap) {
try {
// new com.core.log.RecLog().add(((com.ksgl.map.T_sys_gly)ActionContext.getContext().getSession().get("user")).getBm(),"信息修改操作,id:"+objmap.getId());
pm.updateObj(objmap);
}
catch (Exception ex) {
log.error("修改update Message出错!");
ex.printStackTrace();
}
}
/**
* delete more one
* */
public void delete() {
try {
String names[] = (String[]) ActionContext.getContext().getParameters().
get("id");
for (int i = 0; i < names.length; i++) {
new com.core.log.RecLog().add(((com.ksgl.map.T_sys_gly)ActionContext.getContext().getSession().get("user")).getBm(),"信息删除操作,id:"+names[i]);
pm.deleteObjs(pm.queryObjs(" from Message_answers where id='" + names[i] +
"'"));
}
}
catch (Exception ex) {
log.error("删除delete Message出错!");
ex.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -