Class SearchQuery
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.domain.SearchQuery
-
- Direct Known Subclasses:
SearchCountQuery
,SearchDataQuery
,SearchIncludeQuery
,SearchSortQuery
public abstract class SearchQuery extends Object
Abstract model of a FHIR search query we intend to build. The purpose of this class and its sub-classes is to drive calls to aSearchQueryVisitor
implementation to render a runnable SQL statement.
-
-
Constructor Summary
Constructors Constructor Description SearchQuery(String rootResourceType)
Public constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(SearchExtension ext)
Add the search extension to the modelvoid
add(SearchParam sp)
Add the search parameter to the modelabstract <T> T
getRoot(SearchQueryVisitor<T> visitor)
Process the logical query definition through the visitorString
getRootResourceType()
Getter for the root resource type for this search query<T> T
visit(SearchQueryVisitor<T> visitor)
Get the root query and attach the parameter filters to it<T> void
visitExtensions(T query, SearchQueryVisitor<T> visitor)
Visit each of the extensions configured for this queryprotected <T> void
visitSearchParams(T query, SearchQueryVisitor<T> visitor)
Visit each of the search parameters
-
-
-
Constructor Detail
-
SearchQuery
public SearchQuery(String rootResourceType)
Public constructor- Parameters:
rootResourceType
-
-
-
Method Detail
-
getRootResourceType
public String getRootResourceType()
Getter for the root resource type for this search query- Returns:
-
add
public void add(SearchParam sp)
Add the search parameter to the model- Parameters:
sp
-
-
add
public void add(SearchExtension ext)
Add the search extension to the model- Parameters:
ext
-
-
visit
public <T> T visit(SearchQueryVisitor<T> visitor) throws FHIRPersistenceException
Get the root query and attach the parameter filters to it- Type Parameters:
T
-- Parameters:
visitor
-- Returns:
- Throws:
FHIRPersistenceException
-
visitExtensions
public <T> void visitExtensions(T query, SearchQueryVisitor<T> visitor) throws FHIRPersistenceException
Visit each of the extensions configured for this query- Type Parameters:
T
-- Parameters:
query
-visitor
-- Throws:
FHIRPersistenceException
-
getRoot
public abstract <T> T getRoot(SearchQueryVisitor<T> visitor)
Process the logical query definition through the visitor- Type Parameters:
T
-- Parameters:
visitor
-- Returns:
-
visitSearchParams
protected <T> void visitSearchParams(T query, SearchQueryVisitor<T> visitor) throws FHIRPersistenceException
Visit each of the search parameters- Type Parameters:
T
-- Parameters:
query
-visitor
-- Throws:
FHIRPersistenceException
-
-