Aspect plays a very important role in fetching strategy implementation.
Aspect在抓取策略实现上扮演着重要角色。
See the attached source code for complete working example illustrating the fetching strategy.
该示例附带的源代码详细解释了抓取策略。
Lazy fetching should almost always be used as your default association-fetching strategy.
在大多数情况下,应该使用惰性抓取作为默认的关联抓取策略。
This code overrides the default lazy fetching strategy for the employee's address association.
这个调用覆盖职员地址关联默认的惰性抓取策略。
Hibernate lets the definition of a query override the default fetching strategy for associations.
Hibernate允许查询的定义覆盖关联的默认抓取策略。
Here fetching strategy decision management is kept out side the lower level service or repository layer.
这里我们将对抓取策略的管理放在了底层服务和Respository层之外。
Fetching strategy is a business level cross cutting concern and it changes based on the business use case.
抓取策略是个业务层的横切关注点,它会随着业务的变化而变化。
The employee fetching strategy in the repository class needs to be changed based on the use case required.
Repository类中的employee的抓取策略需要根据实际情况进行调整。
Here we use Aspect Oriented Programming for deciding which fetching strategy needs to used on business use case basis.
这里我们使用了面向方面的编程(Aspect Oriented Programming)以根据业务的不同使用不同的抓取策略。
Although lazy fetching should be the primary fetching strategy for most applications, it does add a few complications.
尽管惰性抓取应该作为大多数应用程序的主要抓取策略,但是它增加了复杂性。
The decision of injecting the above fetching strategy for the required business use case is placed in aspect as shown below.
由aspect将上述的抓取策略注入到相关的业务中,如下所示。
When used with collection-based associations, the query can return a different number of rows than would be returned in the default fetching strategy.
在使用基于集合的关联时,查询返回的行数可能与默认抓取策略返回的行数不同。
As any new business use case might require a different fetching strategy and can be applied with out modifying the lower level service or repository API.
任何新的业务都可能需要不同的抓取策略,这样我们就无需修改底层服务或是Respository层的API就能应用新的抓取策略了。
Unless you have a legacy table that has many columns you don't need, this fetching strategy usually can't be justified since it involves extra SQL for the lazy property group.
除非有一张拥有很多你不需要的字段的遗留表,否则不应该使用这种抓取策略,因为它的延迟属性分组会带来额外的SQL。
Hibernate allows you to define a fetching strategy at two locations. One is to declare it in the mapping metadata; the other is to override it in either the HQL or the Criteria.
Hibernate允许在两个地方定义数据抓取策略,一处是在映射元数据中,另一处是在HQL或Criteria中覆盖它。
Hibernate allows you to define a fetching strategy at two locations. One is to declare it in the mapping metadata; the other is to override it in either the HQL or the Criteria.
Hibernate允许在两个地方定义数据抓取策略,一处是在映射元数据中,另一处是在HQL或Criteria中覆盖它。
应用推荐