分类: LINUX
2005-12-25 15:12:54
/* * Created on 2003-10-11 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package com.ewuxi.champion.persistence.dao; |
import java.util.HashMap; import java.util.List; |
import com.ewuxi.champion.exception.DaoException; import com.ibatis.db.sqlmap.SqlMap; |
/** * @author champion * *attachment数据库操作对象 */ |
public class AttachDb { |
/** * @param vo * @throws DaoException * 插入一条记录 */ public void insert(HashMap vo) throws DaoException { try { SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao()); sqlMap.executeUpdate("insertattachmentDao", vo); } catch (Exception e) { throw new DaoException(e); } } /** * @param vo * @throws DaoException * 删除一条记录 */ public void delete(HashMap vo) throws DaoException { try { SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao()); sqlMap.executeUpdate("deleteByPrimaryKeyattachmentDao", vo); } catch (Exception e) { throw new DaoException(e); } } /** * @param vo * @throws DaoException * 修改一条记录 */ public void update(HashMap vo) throws DaoException { try { SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao()); sqlMap.executeUpdate("updateByPrimaryKeyattachmentDao", vo); } catch (Exception e) { throw new DaoException(e); } } /** * @param vo * @return * @throws DaoException * 查找一条记录 */ public HashMap findByPk(HashMap vo) throws DaoException { try { SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao()); return (HashMap) sqlMap.executeQueryForObject( "findByPrimaryKeyattachmentDao", vo); } catch (Exception e) { throw new DaoException(e); } } public List find(Object vo) throws DaoException { try { SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao()); return (List) sqlMap.executeQueryForList("findattachmentDao", vo); } catch (Exception e) { throw new DaoException(e); } } } |