关于dao层的一个hibernate操作,求解释
controller:
for(int i = 10; i < 23; i++){
countList = countInfoDao.hoursDetectList(i,time, path);
}
dao: String sql="select count(distinct clientMac) from PresenceEntity where path like '"+ path +"' and clientType='Uncategorized Device' and timeStamp like '" + time +" "+i+"%' order by timeStamp asc";
return getHibernateTemplate().find(sql);
像这样我执行一个循环的查询,速度怎么那么慢,有没有什么方法提速一些??坐等。
for(int i = 10; i < 23; i++){
countList = countInfoDao.hoursDetectList(i,time, path);
}
dao: String sql="select count(distinct clientMac) from PresenceEntity where path like '"+ path +"' and clientType='Uncategorized Device' and timeStamp like '" + time +" "+i+"%' order by timeStamp asc";
return getHibernateTemplate().find(sql);
像这样我执行一个循环的查询,速度怎么那么慢,有没有什么方法提速一些??坐等。

...全文
相关推荐
Hibernate_通用DAO模式,一个写好的dao层
这个是不同类型的表单通用的dao模式,简洁明了,注释清楚,可移植性很强
Service层和DAO层解析
dao完成连接数据库修改删除添加等的实现细节,例如sql语句是怎么写的,怎么把对象放入数据库的。service层是面向功能的,一个个功能模块比如说银行登记并完成一次存款,UI要把请求给service层,然后service曾将这一个case分解成许多步骤调用底层的实现完成这次存款,dao就是下面那层。
Hibernate封装dao层
Hibernate封装dao层
Spring的作用贯穿了整个中间层,将Web层、Service层、DAO层及PO无缝整合
Spring的作用贯穿了整个中间层,将Web层、Service层、DAO层及PO无缝整合,其数据服务层用来存放数据。 一个良好的框架可以让开发人员减轻重新建立解决复杂问题方案的负担和精力;它可以被扩展以进行内部的定制化;并且有强大的用户社区来支持它。框架通常能很好的解决一个问题。然而,你的应用是分层的,可能每一个层都需要各自的框架。仅仅解决UI问题并不意味着你能够很好的将业务逻辑和持久性逻辑和UI 组件很好的耦合。
使用代理实现Hibernate Dao层自动事务
NULL 博文链接:https://blessht.iteye.com/blog/804385


Web 开发
