Package rife.database.queries
Class ReadQueryTemplate
java.lang.Object
rife.database.queries.ReadQueryTemplate
An instance of
ReadQueryTemplate will obtain a SQL from a
Template block. If the template is provided but no block name,
the entire content of the template will be used as the SQL query.
This allows you to write your custom SQL queries in dedicated templates,
to name them, and to use them together with the functionalities that are
provided by DbQueryManager
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty instance ofReadQueryTemplate.ReadQueryTemplate(Template template) Creates a new instance ofReadQueryTemplatewith the template instance whose content provides the SQL query that will be executed.ReadQueryTemplate(Template template, String block) Creates a new instance ofReadQueryTemplatewith the template instance and block name that provide the SQL that will be executed. -
Method Summary
Modifier and TypeMethodDescriptionSets the name of the template block.voidclear()getBlock()Retrieves the name of the template block.rife.database.capabilities.CapabilitiesgetSql()Retrieves the template instance.voidSets the name of the template block.voidsetExcludeUnsupportedCapabilities(boolean flag) voidsetTemplate(Template template) Sets the template instance.Sets the template instance.
-
Constructor Details
-
ReadQueryTemplate
public ReadQueryTemplate()Creates a new empty instance ofReadQueryTemplate.- Since:
- 1.0
-
ReadQueryTemplate
Creates a new instance ofReadQueryTemplatewith the template instance whose content provides the SQL query that will be executed.- Parameters:
template- the template instance- Since:
- 1.0
-
ReadQueryTemplate
Creates a new instance ofReadQueryTemplatewith the template instance and block name that provide the SQL that will be executed.- Parameters:
template- the template instanceblock- the name of the template block- Since:
- 1.0
-
-
Method Details
-
template
Sets the template instance.- Parameters:
template- the template instance- Returns:
- this
ReadQueryTemplateinstance. - Since:
- 1.0
- See Also:
-
setTemplate
Sets the template instance.- Parameters:
template- the template instance- Since:
- 1.0
- See Also:
-
getTemplate
Retrieves the template instance.- Returns:
- the template instance; or
nullif no template instance was provided - Since:
- 1.0
- See Also:
-
block
Sets the name of the template block.- Parameters:
block- the name of the template block- Returns:
- this
ReadQueryTemplateinstance. - Since:
- 1.0
- See Also:
-
setBlock
Sets the name of the template block.- Parameters:
block- the name of the template block- Since:
- 1.0
- See Also:
-
getBlock
Retrieves the name of the template block.- Returns:
- the name of the template block; or
nullif no block name was provided - Since:
- 1.0
- See Also:
-
clear
public void clear() -
getSql
-
getParameters
- Specified by:
getParametersin interfaceQuery
-
getCapabilities
public rife.database.capabilities.Capabilities getCapabilities()- Specified by:
getCapabilitiesin interfaceQuery
-
setExcludeUnsupportedCapabilities
public void setExcludeUnsupportedCapabilities(boolean flag) - Specified by:
setExcludeUnsupportedCapabilitiesin interfaceQuery
-