The DAO layer has strong database cohesion.
dao层具有强大的数据库内聚力。
The DAO participates in a global transaction.
dao加入一个全局事务。
A concrete class that implements the DAO interface.
一个实现了dao接口的具体类。
Add the 10-line Spring configuration file for the DAO.
为dao添加10行spring配置文件。
Transaction demarcation code is separated from the DAO.
事务界定代码从DAO中分离出来。
These are handled outside the DAO to achieve flexibility.
这些不由DAO处理是为了实现灵活性。
For the sample application the DAO trait looks as follows.
对于该示例应用来说,其DAOtrait如下代码所示。
Transaction demarcation code is embedded inside the DAO class.
事务界定代码嵌入在dao类中。
Should the DAO be responsible for starting and ending transactions?
DAO 是否要负责事务的开始和结束?
How will exceptions be handled within the DAO implementation class?
在DAO实现类中如何处理异常?
When implementing the DAO pattern, consider the following questions
在实现DAO模式时,考虑以下问题
The DAO may allow queries based on criteria other than the primary key.
DAO可允许基于除主键之外的标准进行查询。
The DAO is not responsible for handling transactions, sessions, or connections.
DAO不负责处理事务、会话或连接。
The DAO may use Spring's declarative transaction demarcation as described above.
DAO可以使用上面描述的Spring声明式事务划分。
The DAO completely hides the data source implementation details from its clients.
DAO将数据源的实现细节对客户端完全的隐藏了起来.
The DAO will be responsible for accessing the user's data from the LDAP directory.
DAO负责访问来自于LDAP目录的用户数据。
This implementation of the DAO pattern consists of the classes and interfaces shown below
DAO模式的这个实现包含下面列出的类和接口
The DAO pattern protects your application from being tied to a particular persistence approach.
DAO模式可以保护应用程序,使之不必与特定持久性方法捆绑在一起。
Some transactions might start in the API layer, some in the business layer, and some even in the DAO layer.
一些事务可能在API层中开始,一些在业务层中开始,还有一些甚至在DAO 层中开始。
The return value of a finder is normally a collection of the domain object for which the DAO is responsible.
查找器的返回值通常是DAO负责的域对象集合。
As this article has shown, implementing the DAO pattern entails more than just writing low-level data access code.
正如本文所展示的,实现DAO模式需要做比编写低级别的数据访问代码更多的工作。
The DAO pattern, as its name implies, encapsulates logic for accessing data in an object or set of related objects.
顾名思义,DAO模式封装了访问一个对象或相关对象集中的数据的逻辑。
I choose to wrap the DAO in an interface, so I can switch my data access layer to use different persistence strategies.
我选择将这个dao封装在一个接口中,这样我就能够切换数据访问层来使用不同的持久性策略。
Zhuangzi's aesthetics is a life aesthetics, it builds a life aesthetic system of the Dao based on life as logic origin.
庄子美学是生命美学,它以生命为逻辑起点构建起“道”的美学体系。
Finally, what does change with this swap is the way that the DAO is instantiated in the service, as shown in Listing 10.
最后,在这种替换中,真正改变的是DAO在服务中被实例化的方式。
These examples show the convenience that the DAO pattern provides; however, more important is the safety that DAO provides.
这些例子展示了dao模式提供的一些便利;然而,DAO提供的安全性更为重要。
If you look at Listing 2, you can easily see the tight coupling between the underlying database schema and the DAO classes.
如果查看清单2,您可以轻松地看到底层数据库模式与dao类之间的紧密耦合。
The DAO implementation class used in this article is intended as an example implementation; other implementations do exist.
本文使用的DAO实现类旨在作为示例实现,实际上还存在其他实现。
Methods in the DAO interface should throw checked exceptions only if the caller can reasonably be expected to handle the exception.
只有在可以合理地预期调用者可以处理异常时,DAO接口中的方法才应该抛出检查过的异常。
Methods in the DAO interface should throw checked exceptions only if the caller can reasonably be expected to handle the exception.
只有在可以合理地预期调用者可以处理异常时,DAO接口中的方法才应该抛出检查过的异常。
应用推荐