How to implement batch fetching with Fluent NHibernate when working with Oracle?

Deadly 提交于 2019-11-26 10:05:05

问题


I\'ve tried using Future feature with Oracle but NHibernate does not support it.

I\'ve read some about Batch Fetching feature: http://docs.huihoo.com/hibernate/nhibernate-reference-1.2.0/performance.html

How could I use it with Fluent NHibernate? how should it be configured?


回答1:


To give you the answer how to use batching with fluent:

1) on the colleciton

HasMany<MyEntity>(x => x.Entities)
  .BatchSize(100);

2) on a class level

public MyEntityMap()
{
    Id(x => x....
    ...
    BatchSize(100);

This corresponds with the 19.1.5. Using batch fetching



来源:https://stackoverflow.com/questions/20995583/how-to-implement-batch-fetching-with-fluent-nhibernate-when-working-with-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!