Class InMemoryBeanQuerySession<T>
- Type Parameters:
T- The row (bean) type.
- All Implemented Interfaces:
AutoCloseable
BeanQuerySession over one in-memory collection.
The rows are filtered once, when the session is built, through the context guard and the session guard.
Every call then searches, sorts and pages that scoped list. All $regex matching in one call shares one
deadline (regexTimeout). close() is a
no-op, but use try-with-resources anyway so the code does not change if the engine does.
Example:
- Since:
- 10.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases whatever the session acquired.protected CountsdoCount(ResolvedQuery query) Engine hook forBeanQuerySession.count(BeanQuery).doFind(ResolvedQuery query) Engine hook forBeanQuerySession.find(BeanQuery).doFindValues(ResolvedQuery query) Engine hook forBeanQuerySession.findValues(BeanQuery).doStream(ResolvedQuery query) Engine hook forBeanQuerySession.stream(BeanQuery).doStreamValues(ResolvedQuery query) Engine hook forBeanQuerySession.streamValues(BeanQuery).Returns the context that created this session (throughBeanQueryContext.createSession()or an engine'sgetSession(...)shortcut).Methods inherited from class org.apache.juneau.commons.beanquery.BeanQuerySession
columns, count, find, findValues, getMaxSearchClauses, getMaxSortKeys, page, resolve, stream, streamValues
-
Method Details
-
getContext
Returns the context that created this session (throughBeanQueryContext.createSession()or an engine'sgetSession(...)shortcut).Engines whose session builder is given a narrower context type (for example,
InMemoryBeanQuerySession) override this with a covariant return type.- Overrides:
getContextin classBeanQuerySession<T>- Returns:
- The context that created this session.
-
doFind
Description copied from class:BeanQuerySessionEngine hook forBeanQuerySession.find(BeanQuery).- Specified by:
doFindin classBeanQuerySession<T>- Parameters:
query- The validated query.- Returns:
- The page. Build it with
BeanQuerySession.page(List, ResolvedQuery, LongSupplier, LongSupplier).
-
doFindValues
Description copied from class:BeanQuerySessionEngine hook forBeanQuerySession.findValues(BeanQuery).- Specified by:
doFindValuesin classBeanQuerySession<T>- Parameters:
query- The validated query.- Returns:
- The page.
-
doCount
Description copied from class:BeanQuerySessionEngine hook forBeanQuerySession.count(BeanQuery).- Specified by:
doCountin classBeanQuerySession<T>- Parameters:
query- The validated query.- Returns:
- The counts.
-
doStream
Description copied from class:BeanQuerySessionEngine hook forBeanQuerySession.stream(BeanQuery).- Specified by:
doStreamin classBeanQuerySession<T>- Parameters:
query- The validated query.- Returns:
- The rows.
-
doStreamValues
Description copied from class:BeanQuerySessionEngine hook forBeanQuerySession.streamValues(BeanQuery).- Specified by:
doStreamValuesin classBeanQuerySession<T>- Parameters:
query- The validated query.- Returns:
- The rows.
-
close
Description copied from class:BeanQuerySessionReleases whatever the session acquired. Never throws a checked exception.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classBeanQuerySession<T>
-