This code overrides the default lazy fetching strategy for the employee's address association.
这个调用覆盖职员地址关联默认的惰性抓取策略。
Although lazy fetching should be the primary fetching strategy for most applications, it does add a few complications.
尽管惰性抓取应该作为大多数应用程序的主要抓取策略,但是它增加了复杂性。
By default, if lazy fetching is used, 11 queries will be executed - one for the list of employees and one for each employee's address.
如果使用惰性抓取,在默认情况下将执行11个查询—执行一个查询获取职员的列表,然后为获取每个职员的地址各执行一次查询。
If the same line of code executes in the presentation tier, the value of size variable is 0 if the default lazy fetching configuration for one-to-many associations is in use.
如果使用默认懒加载(lazy)配置的一对多关联,并在表示层中执行同一行代码,size变量的值为0。
Another issue with lazy fetching is that the database connection has to be retained until all the required data is fetched else the application will throw a lazy loading exception.
延迟抓取的另一个问题就是在获取到请求的数据前要一直打开数据库连接,否则应用就会抛出一个延迟加载异常。
Lazy fetching minimizes the amount of data queried from the database.
惰性抓取可以尽可能减少从数据库查询到的数据量。
Lazy fetching should almost always be used as your default association-fetching strategy.
在大多数情况下,应该使用惰性抓取作为默认的关联抓取策略。
Lazy fetching should almost always be used as your default association-fetching strategy.
在大多数情况下,应该使用惰性抓取作为默认的关联抓取策略。
应用推荐