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模式时,考虑以下问题
We are here and we support you in your truth of the Dao and Tao within.
我们龙族就在这里,我们支持你找到内在道之父与道之母的真相。
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模式的这个实现包含下面列出的类和接口
By adding extra code into the DAO to write all relevant details out to the AUDIT database.
通过添加一些额外的代码到DAO就可以写下相关的细节到审计数据库内。
The DAO pattern protects your application from being tied to a particular persistence approach.
DAO模式可以保护应用程序,使之不必与特定持久性方法捆绑在一起。
If you choose the latter approach, transaction demarcation code will be external to the DAO class.
如果选择后一种方式,那么事务界定代码就是在dao类外面。
Some transactions might start in the API layer, some in the business layer, and some even in the DAO layer.
一些事务可能在API层中开始,一些在业务层中开始,还有一些甚至在DAO 层中开始。
The business component that relies on the DAO USES the simpler interface exposed by the DAO for its clients.
依赖于DAO的商业组件只对他的客户端暴露一些非常简单的DAO外部接口。
The return value of a finder is normally a collection of the domain object for which the DAO is responsible.
查找器的返回值通常是DAO负责的域对象集合。
An application is using the DAO pattern to save data into multiple tables, each DAO used one save on one table.
应用程序使用dao模式来将数据存储到多个表中,一个应用程序使用的每个DAO都保存在一张表中。
As this article has shown, implementing the DAO pattern entails more than just writing low-level data access code.
正如本文所展示的,实现DAO模式需要做比编写低级别的数据访问代码更多的工作。
I choose to wrap the DAO in an interface, so I can switch my data access layer to use different persistence strategies.
我选择将这个dao封装在一个接口中,这样我就能够切换数据访问层来使用不同的持久性策略。
The DAO pattern, as its name implies, encapsulates logic for accessing data in an object or set of related objects.
顾名思义,DAO模式封装了访问一个对象或相关对象集中的数据的逻辑。
These examples show the convenience that the DAO pattern provides; however, more important is the safety that DAO provides.
这些例子展示了dao模式提供的一些便利;然而,DAO提供的安全性更为重要。
For example, imagine applying retry logic in the event of particular exceptions being encountered across the DAO layer.
比如,想象一下在跨dao层遭遇特殊异常时要使用重试逻辑。
应用推荐