MessageDAO.java
资源名称:cindyblog.rar [点击查看]
上传用户:cdpainuo
上传日期:2022-07-12
资源大小:5257k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
Java
- package com.appspot.cindyblog.dao;
- import javax.persistence.EntityManager;
- import com.appspot.cindyblog.pojo.MessageBean;
- public class MessageDAO extends BaseDAO{
- public boolean updateMessage(MessageBean o,EntityManager em) {
- boolean b = false;
- try {
- MessageBean m = em.find(MessageBean.class, o.getId());
- m.setName(o.getName());
- m.setTime(o.getTime2());
- m.setContent(o.getContent2());
- b = true;
- }catch(Exception ex){
- ex.printStackTrace();
- } finally {
- em.flush();
- return b;
- }
- }
- }