Interface MorpheusSynchronousDataQueryService<M extends MorpheusModel>
- Type Parameters:
M- TheMorpheusModelclass type for this service to query against
- All Known Subinterfaces:
MorpheusSynchronousAffinityGroupService
DataQuery object. There are methods that can be implemented
to provide both MorpheusModel related objects as well as Map objects for use in
DatasetProvider use cases (dropdown and type-ahead components in UI option types).
Often times this interface is used in conjunction with the MorpheusSynchronousIdentityService for providing
an efficient way to sync objects via the MorpheusSynchronousIdentityService.listIdentityProjections(DataQuery) method.
Another implementation also exists for asynchronous rxjava querying of the objects called the
MorpheusDataQueryService. Typically, both should be implemented for use within the plugin api.
It is recommended that the Asynchronous version of the service class is used where possible as it is the most efficient.
An example of where this may be more useful would be in UI rendering methods which are already blocking as is.
Note: This object requires its asynchronous counterpart be implemented as it acts as a simple delegate to that service.
- Since:
- 1.3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault LongPerforms a query operation based on the filters set in theDataQueryobject passed and returns a simple total count of the results.default MPerforms a query operation on the database returning the first result as aMorpheusModelobject.default MFetches a singleMorpheusModelby its Identifier (id) field.Reference to the asynchronous data serviceMorpheusDataServiceimplementation as this interface acts as a simple delegate blocking wrapper for it.list()Performs a list all operation on the database returning the results asMorpheusModelobjects.Performs a query operation on the database returning the results asMorpheusModelobjects.Fetches a stream ofMorpheusModelobjects based on a collection of Identifiers (id).Performs a list all operation on the database returning the results as Map objects typically containing keys of (name,value) for use in dropdown or type-ahead components within the UI.listOptions(DataQuery query) Performs a query operation on the database returning the results as Map objects typically containing keys of (name,value) for use in dropdown or type-ahead components within the UI.default DataQueryResultPerforms a query operation on the database just likeMorpheusDataQueryService.list(DataQuery)with a query, but the result is no longer a stream of individualMorpheusModel.
-
Method Details
-
getDataQueryService
MorpheusDataQueryService<M> getDataQueryService()Reference to the asynchronous data serviceMorpheusDataServiceimplementation as this interface acts as a simple delegate blocking wrapper for it.- Returns:
- the asynchronous data service to be used by the default method implementations in this interface.
-
count
-
get
Fetches a singleMorpheusModelby its Identifier (id) field. For more advanced single object fetches please refer toMorpheusDataQueryService.find(DataQuery).Note: This method does not factor in any sort of access/security control and should not be used in areas where this is required.
- Parameters:
id- the database identifier to fetch an object by.- Returns:
- a representation of a
MorpheusModeldepending on if the object was found or not.
-
listById
Fetches a stream ofMorpheusModelobjects based on a collection of Identifiers (id). This is often used in conjunction with theMorpheusSynchronousIdentityService.listIdentityProjections(DataQuery)and theSyncTaskfor efficiently only fetching batches of objects we want to perform update operations on.Note: This method does not factor in any sort of access/security control and should not be used in areas where this is required.
- Parameters:
ids- a collection of Identifiers (ids) to fetch the objects by.- Returns:
- A List of
MorpheusModelobjects based on the ids passed in
-
list
Performs a list all operation on the database returning the results asMorpheusModelobjects.- Returns:
- an Observable stream of
MorpheusModelobjects based on the passed in query.
-
list
Performs a query operation on the database returning the results asMorpheusModelobjects. These queries can be scoped to anAccountIdentityorUserIdentityas well as various filters on arbitrary fields in the database.Note: For more information on how to query please refer to the documentation for the
DataQueryclass.- Parameters:
query- An instance of theDataQueryobject used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- A List of
MorpheusModelobjects based on the passed in query.
-
listOptions
Performs a list all operation on the database returning the results as Map objects typically containing keys of (name,value) for use in dropdown or type-ahead components within the UI. This would typically be paired with aDatasetProvider.- Returns:
- an Observable stream of Map objects based on the passed in query containing name,value pairs.
-
listOptions
Performs a query operation on the database returning the results as Map objects typically containing keys of (name,value) for use in dropdown or type-ahead components within the UI. This would typically be paired with aDatasetProvider. Queries can be scoped to anAccountIdentityorUserIdentityas well as various filters on arbitrary fields in the database.Note: For more information on how to query please refer to the documentation for the
DataQueryclass.- Parameters:
query- An instance of theDataQueryobject used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- A List of Map objects based on the passed in query containing name,value pairs.
-
find
Performs a query operation on the database returning the first result as aMorpheusModelobject. These queries can be scoped to anAccountIdentityorUserIdentityas well as various filters on arbitrary fields in the database.Note: For more information on how to query please refer to the documentation for the
DataQueryclass.- Parameters:
query- An instance of theDataQueryobject used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- A
MorpheusModelobject based on the passed in query.
-
search
Performs a query operation on the database just likeMorpheusDataQueryService.list(DataQuery)with a query, but the result is no longer a stream of individualMorpheusModel.Note: This is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
Note: For more information on how to query please refer to the documentation for the
DataQueryclass.- Parameters:
query- An instance of theDataQueryobject used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- a Single DataQueryResult representing a collection of result objects along with the metadata about the result. This could be paging data for example.
-