【发布时间】:2012-04-25 22:17:14
【问题描述】:
我已经在谷歌上搜索了几个小时,试图找到一个示例,说明如何在使用 DAO 接口时编写一个不使用 Springs Hibernate 模板的服务方法。让我感到困惑的是,当我将 @Transactional 注释放在服务层而不是 DAO 中时会发生什么。 Service 方法/DAO 接口是否可以互换?
Here is an example where the @Transactional is in the DAO
Here is one with the @Transactional in the Service Layer but using hibernate templates
感谢您的帮助!
【问题讨论】:
标签: java spring hibernate dao hibernate-generic-dao