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

📄 basedao.java

📁 网上购书系统的完整代码
💻 JAVA
字号:
package org.myrose.dao;

import java.util.List;
import org.myrose.conn.MyConn;

import com.ibatis.sqlmap.client.SqlMapClient;

public class BaseDAO {
	public List findList(String sqlId) throws Exception {
		SqlMapClient sqlMapper = MyConn.getSqlMapper();
		List list = sqlMapper.queryForList(sqlId);
		return list;
	}

	public List findList(String sqlId, Object obj) throws Exception {
		SqlMapClient sqlMapper = MyConn.getSqlMapper();
		List list = sqlMapper.queryForList(sqlId, obj);
		return list;
	}

	public Object findEntity(String sqlId, Object obj) throws Exception {
		SqlMapClient sqlMapper = MyConn.getSqlMapper();
		Object result = sqlMapper.queryForObject(sqlId, obj);
		return result;
	}

	public Object addEntity(String sqlId, Object obj) throws Exception {
		SqlMapClient sqlMapper = MyConn.getSqlMapper();
		return sqlMapper.insert(sqlId, obj);
	}

	public int updateEntity(String sqlId, Object obj) throws Exception {
		SqlMapClient sqlMapper = MyConn.getSqlMapper();
		return sqlMapper.update(sqlId, obj);
	}

	public List getList(String sqlId, Object obj, int i, int j)	throws Exception {
		SqlMapClient sqlMapper = MyConn.getSqlMapper();
		return sqlMapper.queryForList(sqlId, obj, i, j);
	}
}

⌨️ 快捷键说明

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