📄 writeresultsetservice.java
字号:
package edu.yinhe.mis.services;
import java.sql.SQLException;
import java.util.ArrayList;
import edu.yinhe.mis.dto.WriteresultsetDTO;
import edu.yinhe.mis.model.DAOFactory;
import edu.yinhe.mis.vo.WriteresultsetVO;
import edu.yinhe.system.common.AppException;
import edu.yinhe.system.model.IBaseDAO;
import edu.yinhe.system.services.Service;
/**
*
* @author 张海亚
* Creation date:04-30-2008
*/
public class Writeresultsetservice extends Service {
private IBaseDAO WriteresultsetDAO=null;
public Object alllist() throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object alllist(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
/**
* 添加谈话记录
* @author 张海亚
* @param obj 传入WriteresultsetDTO类型的对象
* @return flag 添加完成,返回1,反之为0
* @exception SQLException
* creation date :04-30-2008
*/
public Object create(Object obj) throws AppException {
Boolean flag=false;
WriteresultsetDTO wdto=(WriteresultsetDTO )obj;
WriteresultsetDAO=DAOFactory.getWriteresultsetDAO(conn);
try {
flag=(Boolean) WriteresultsetDAO.insert(wdto);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
WriteresultsetDAO=null;//由于项目庞大,节约资源
}
return flag;
}
public Object findAll() throws AppException {
ArrayList list = new ArrayList();
// WriteresultsetDTO wdto=(WriteresultsetDTO )obj;
WriteresultsetDAO=DAOFactory.getWriteresultsetDAO(conn);
try {
list = (ArrayList) WriteresultsetDAO.findAll();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
WriteresultsetDAO=null;//由于项目庞大,节约资源
}
return list;
}
/**
* 查看所有谈话记录
* @author 张海亚
* @param obj 传入WriteresultsetDTO类型的对象
* @return flag 添加完成,返回1,反之为0
* @exception SQLException
* creation date :04-30-2008
*/
public Object findAll(Object obj) throws AppException {
ArrayList list = new ArrayList();
WriteresultsetDTO wdto=(WriteresultsetDTO )obj;
WriteresultsetDAO=DAOFactory.getWriteresultsetDAO(conn);
try {
list=(ArrayList) WriteresultsetDAO.findAll(obj);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
WriteresultsetDAO=null;//由于项目庞大,节约资源
}
return list;
}
public Object findById(Object obj) throws AppException {
return obj;
}
public Object findByObject(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public int getcount() throws AppException {
// TODO Auto-generated method stub
return 0;
}
public int getcount(Object arg0) throws AppException {
// TODO Auto-generated method stub
return 0;
}
public Object list() throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object list(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
/**
* 根据ID号加载writeresultset表信息
* @author 张海亚
* @param obj 传入WriteresultsetDTO类型的对象
* @return flag 添加完成,返回1,反之为0
* @exception SQLException
* creation date :04-30-2008
*/
public Object load(Object obj) throws AppException {
WriteresultsetVO wvo=null;
WriteresultsetDTO wdto=(WriteresultsetDTO )obj;
WriteresultsetDAO=DAOFactory.getWriteresultsetDAO(conn);
try {
wvo=(WriteresultsetVO) WriteresultsetDAO.findById(wdto);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
WriteresultsetDAO=null;//由于项目庞大,节约资源
}
return wvo;
}
/**
* 根据ID号修改writeresultset表信息
* @author 张海亚
* @param obj 传入WriteresultsetDTO类型的对象
* @return flag 添加完成,返回1,反之为0
* @exception SQLException
* creation date :04-30-2008
*/
public Object modify(Object obj) throws AppException {
Integer flag=0;
WriteresultsetDTO wdto=(WriteresultsetDTO )obj;
WriteresultsetDAO=DAOFactory.getWriteresultsetDAO(conn);
try {
flag=(Integer) WriteresultsetDAO.update(wdto);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
WriteresultsetDAO=null;//由于项目庞大,节约资源
}
return flag;
}
/**
* 根据ID号删除writeresultset表信息
* @author 张海亚
* @param obj 传入WriteresultsetDTO类型的对象
* @return flag 添加完成,返回1,反之为0
* @exception SQLException
* creation date :04-30-2008
*/
public Object remove(Object obj) throws AppException {
Integer flag=0;
WriteresultsetDTO wdto=(WriteresultsetDTO )obj;
WriteresultsetDAO=DAOFactory.getWriteresultsetDAO(conn);
try {
flag=(Integer) WriteresultsetDAO.delete(wdto);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
WriteresultsetDAO=null;//由于项目庞大,节约资源
}
return flag;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -