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
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
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<T>
you need an executable query (Criteria/QueryOver/HQL/LINQ). Otherwise, future has no way of resolving it.
© 2022 - 2024 — McMap. All rights reserved.
Get
would make a lot of sense. "FutureGet
" could return a proxy and when accessing the first, it could load all "future-got" proxies in a single database roundtrip. Without flushing the session and only including the objects which are not in cache yet, which are advantages ofGet
compared to a query. – Trimetrogon