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
ConstructorDescriptionCreates a new empty instance ofReadQueryTemplate
.ReadQueryTemplate
(Template template) Creates a new instance ofReadQueryTemplate
with the template instance whose content provides the SQL query that will be executed.ReadQueryTemplate
(Template template, String block) Creates a new instance ofReadQueryTemplate
with 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.void
clear()
getBlock()
Retrieves the name of the template block.rife.database.capabilities.Capabilities
getSql()
Retrieves the template instance.void
Sets the name of the template block.void
setExcludeUnsupportedCapabilities
(boolean flag) void
setTemplate
(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 ofReadQueryTemplate
with 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 ofReadQueryTemplate
with 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
ReadQueryTemplate
instance. - 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
null
if 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
ReadQueryTemplate
instance. - 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
null
if no block name was provided - Since:
- 1.0
- See Also:
-
clear
public void clear() -
getSql
-
getParameters
- Specified by:
getParameters
in interfaceQuery
-
getCapabilities
public rife.database.capabilities.Capabilities getCapabilities()- Specified by:
getCapabilities
in interfaceQuery
-
setExcludeUnsupportedCapabilities
public void setExcludeUnsupportedCapabilities(boolean flag) - Specified by:
setExcludeUnsupportedCapabilities
in interfaceQuery
-