NHibernate Future with Get()

后端 未结 1 1062
醉梦人生
醉梦人生 2021-01-15 16:20

How can I use Future for delayed execution with Get() to retrieve a single record (or Load()?)

Also, can I use Future with a detached QueryOver

1条回答
  •  时光取名叫无心
    2021-01-15 16:57

    Future with Load does not make any sense, as Load does not go to the DB.

    Future with get doesn't make sense either, as Get returns an instance which might already be loaded, in which case it doesn't go to the DB either. The closest you can get to that is a query by id.

    In order to get a Future you need an executable query (Criteria/QueryOver/HQL/LINQ). Otherwise, future has no way of resolving it.

    0 讨论(0)
提交回复
热议问题