https://github.com/MoneyHacker/common-dao
common-dao,MyBatis,通用Dao组件
https://github.com/MoneyHacker/common-dao
common-dao mybatis-mapper mybatis-xml xml
Last synced: 2 months ago
JSON representation
common-dao,MyBatis,通用Dao组件
- Host: GitHub
- URL: https://github.com/MoneyHacker/common-dao
- Owner: MoneyHacker
- License: apache-2.0
- Created: 2018-12-05T08:19:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-02T06:26:56.000Z (about 6 years ago)
- Last Synced: 2024-10-24T15:38:04.550Z (7 months ago)
- Topics: common-dao, mybatis-mapper, mybatis-xml, xml
- Language: Java
- Homepage:
- Size: 77.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 一 通用Dao组件,Common-dao, Mybaits 一个链接可以查询多个数据表
- 每张表只需要生成Bean和xml文件即可
- 一个Dao可以查询同一个链接池关联数据库下所有表
- Bean 及 xml快速生成,可参考项目generator
# 二示例,具体其它方法可以查看ICommonDao接口和测试类DaoTester@Resource
private ICommonDao commonDao;
@Test
public void test() {
SysUser user = commonDao.get(1L, SysUser.class);
Assert.assertNotNull(user);
//根据内置sql查询,按条件查询
user = commonDao.get(SysUser.class,"userName","aaa");
Assert.assertNotNull(user);
//根据自己定义sql查询,sqlId是在xml的sqlId
List userList = commonDao.getListBySqlId(SysUser.class, "selectByIds","list", Arrays.asList(1L,2L));
Assert.assertNotNull(userList);
}# 三 交流(QQ群:51567067) 支持