Package wt.fc
Class PagingSessionHelper
java.lang.Object
wt.fc.PagingSessionHelper
- All Implemented Interfaces:
RemoteAccess
This class provides static helper methods for managing PagingSessions.
These methods hide the implementationd details of using the PersistenceManager
for paging.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclosePagingSession(long a_sessionId) This method closes a paging session.static voidclosePagingSession(PagingSession a_pagingSession) This method closes a paging session.static PagingQueryResultfetchPagingSession(int a_offset, int a_range, long a_sessionId) This method fetches a page of data from an opened paging session.static intgetTotalCount(long a_sessionId) Returns total count of results for the specified paging session.static PagingQueryResultopenPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, Class a_linkClass, boolean a_onlyOtherSide) This method opens a paging session for navigation given the source object, the role, and linkclass.static PagingQueryResultopenPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, QuerySpec a_criteria, boolean a_onlyOtherSide) This method opens a paging session for navigation given the source object, the role, and criteria.static PagingQueryResultopenPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec) This method opens a paging session using the specified snapshot query.static PagingQueryResultopenPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, boolean a_backgroundThreadEnabled) This method opens a paging session using the specified snapshot query.static PagingQueryResultopenPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold) This method opens a paging session using the specified snapshot query.static PagingQueryResultopenPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold, boolean a_backgroundThreadEnabled) This method opens a paging session using the specified snapshot query.
-
Method Details
-
openPagingSession
public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec) throws WTException This method opens a paging session using the specified snapshot query.
Supported API: true- Parameters:
a_offset- Offset value to fetch, intitially.a_range- Specifies the range for the intial page of dataa_snapshotSpec- Statement to use as the source of the paging query.- Returns:
- PagingQueryResult
- Throws:
WTException
-
openPagingSession
public static PagingQueryResult openPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, Class a_linkClass, boolean a_onlyOtherSide) throws WTException This method opens a paging session for navigation given the source object, the role, and linkclass. Note: It doesn't support nevigation for Federated object.
Supported API: true- Parameters:
a_offset- Offset value to fetch, intitially.a_range- Specifies the range for the intial page of dataa_source- The persistable object to navigate.a_role- The role to navigate toa_linkClass- The link class for the association to navigatea_onlyOtherSide- Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned.- Returns:
- PagingQueryResult
- Throws:
WTException
-
openPagingSession
public static PagingQueryResult openPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, QuerySpec a_criteria, boolean a_onlyOtherSide) throws WTException This method opens a paging session for navigation given the source object, the role, and criteria. Note: It doesn't support nevigation for Federated object.
Supported API: true- Parameters:
a_offset- Offset value to fetch, intitially.a_range- Specifies the range for the intial page of dataa_source- The persistable object to navigate.a_role- The role to navigate toa_criteria- Selection criteria for the navigate. This QuerySpec must contain the target and link class at class index 0 and 1, respectively.a_onlyOtherSide- Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned.- Returns:
- PagingQueryResult
- Throws:
WTException
-
fetchPagingSession
public static PagingQueryResult fetchPagingSession(int a_offset, int a_range, long a_sessionId) throws WTException This method fetches a page of data from an opened paging session.
Supported API: true- Parameters:
a_offset- Offset value to fetch.a_range- Specifies the range for the page of dataa_sessionId- Specifies the paging session to fetch from.- Returns:
- PagingQueryResult
- Throws:
WTException
-
closePagingSession
This method closes a paging session.
Supported API: true- Parameters:
a_pagingSession- PagingSession instance to close.- Throws:
WTException
-
closePagingSession
This method closes a paging session.
Supported API: true- Parameters:
a_sessionId- Specifies the paging session to close.- Throws:
WTException
-
openPagingSession
public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold) throws WTException This method opens a paging session using the specified snapshot query.
Supported API: true- Parameters:
a_offset- Offset value to fetch, intitially.a_range- Specifies the range for the intial page of dataa_snapshotSpec- Statement to use as the source of the paging query.a_threshold- Specifies a paging thresold for this paging session. If results are less than this value, then no paging session is opened and all results are immediately returned.- Returns:
- PagingQueryResult
- Throws:
WTException
-
getTotalCount
Returns total count of results for the specified paging session. If a negative value is returned, then it means an error occurredn during paging processing and results are not accessible. If zero is returned, then paging processing is still occurring and results are not accessible. A positive return value indicates the actual total count and all results are accessible.
Supported API: true- Parameters:
a_sessionId- The session id for the paging session of interest.- Returns:
- int
- Throws:
WTException
-
openPagingSession
public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold, boolean a_backgroundThreadEnabled) throws WTException This method opens a paging session using the specified snapshot query.
Supported API: true- Parameters:
a_offset- Offset value to fetch, intitially.a_range- Specifies the range for the intial page of dataa_snapshotSpec- Statement to use as the source of the paging query.a_threshold- Specifies a paging thresold for this paging session. If results are less than this value, then no paging session is opened and all results are immediately returned.a_backgroundThreadEnabled- Indicates the intermidiate process should use background thread or not, and the default value will be true.- Returns:
- PagingQueryResult
- Throws:
WTException
-
openPagingSession
public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, boolean a_backgroundThreadEnabled) throws WTException This method opens a paging session using the specified snapshot query.
Supported API: true- Parameters:
a_offset- Offset value to fetch, intitially.a_range- Specifies the range for the intial page of dataa_snapshotSpec- Statement to use as the source of the paging query.a_backgroundThreadEnabled- Indicates the intermidiate process should use background thread or not, and the default value will be true.- Returns:
- PagingQueryResult
- Throws:
WTException
-