Class QueryWrapper
java.lang.Object
net.ontopia.topicmaps.query.utils.QueryWrapper
EXPERIMENTAL: Class a la Spring's JDBC templates to simplify use of
the tolog query engine API.
- Since:
- 3.4.4
-
Constructor Summary
ConstructorsConstructorDescriptionQueryWrapper(TopicMapIF topicmap) EXPERIMENTAL: Creates a wrapper for this particular topic map. -
Method Summary
Modifier and TypeMethodDescriptionbooleanEXPERIMENTAL: Returns true if the query produces a row and false if the query produces no rows.booleanEXPERIMENTAL: Returns true if the query produces a row and false if the query produces no rows.makeParams(String name, Object value) EXPERIMENTAL: Utility method for creating parameter maps.queryForList(String query) EXPERIMENTAL: Runs the query, and returns a the single value in each row.queryForList(String query, Map params) EXPERIMENTAL: Runs the query, and returns a the single value in each row.queryForList(String query, RowMapperIF mapper) EXPERIMENTAL: Runs the query, and calls the mapper for each row in the query result.queryForList(String query, RowMapperIF mapper, Map params) EXPERIMENTAL: Runs the query with the given parameters, and calls the mapper for each row in the query result.queryForMap(String query) EXPERIMENTAL: Returns a map of the first row of the query results, with each variable name (without $) as a key and each variable value as the value of the key.queryForMap(String query, Map params) EXPERIMENTAL: Returns a map of the first row of the query results, with each variable name (without $) as a key and each variable value as the value of the key.queryForMaps(String query) EXPERIMENTAL: Returns a list of Map<String, Object> values for each row in the query, with the variable name as the key.queryForMaps(String query, Map params) EXPERIMENTAL: Returns a list of Map<String, Object> values for each row in the query, with the variable name as the key.queryForObject(String query) EXPERIMENTAL: Returns the value in the first column in the first row of the query result.queryForObject(String query, Map params) EXPERIMENTAL: Returns the value in the first column in the first row of the query result.queryForObject(String query, RowMapperIF mapper) EXPERIMENTAL: Returns the mapping of the value in the first column in the first row of the query result.queryForObject(String query, RowMapperIF mapper, Map params) EXPERIMENTAL: Returns the mapping of the value in the first column in the first row of the query result.queryForString(String query) EXPERIMENTAL: Returns a String from the first column in the first row of the query result.queryForString(String query, Map params) EXPERIMENTAL: Returns a String from the first column in the first row of the query result.queryForTopic(String query) EXPERIMENTAL: Returns a topic from the first column in the first row of the query result.queryForTopic(String query, Map params) EXPERIMENTAL: Returns a topic from the first column in the first row of the query result.voidvoidsetDeclarations(String declarations) EXPERIMENTAL: Sets the parsing context for the query processor.intEXPERIMENTAL: Runs an update statement, returning the number of changed rows.intEXPERIMENTAL: Runs an update statement, returning the number of changed rows.
-
Constructor Details
-
QueryWrapper
EXPERIMENTAL: Creates a wrapper for this particular topic map.
-
-
Method Details
-
getQueryProcessor
-
getDeclarationContext
-
setDeclarationContext
-
setDeclarations
EXPERIMENTAL: Sets the parsing context for the query processor. Each call to this method overwrites the results from previous calls.- Parameters:
declarations- a tolog fragment containing prefix declarations
-
makeParams
EXPERIMENTAL: Utility method for creating parameter maps. -
queryForList
EXPERIMENTAL: Runs the query, and returns a the single value in each row. -
queryForList
EXPERIMENTAL: Runs the query, and returns a the single value in each row. -
queryForList
EXPERIMENTAL: Runs the query, and calls the mapper for each row in the query result. Returns a list of all the objects produced by the mapper in query result order. -
queryForList
EXPERIMENTAL: Runs the query with the given parameters, and calls the mapper for each row in the query result. Returns a list of all the objects produced by the mapper in query result order. -
queryForMap
EXPERIMENTAL: Returns a map of the first row of the query results, with each variable name (without $) as a key and each variable value as the value of the key. If the query produces no rows the method returns null; if it produces more than one an exception is thrown. -
queryForMap
EXPERIMENTAL: Returns a map of the first row of the query results, with each variable name (without $) as a key and each variable value as the value of the key. If the query produces no rows the method returns null; if it produces more than one an exception is thrown. -
queryForMaps
EXPERIMENTAL: Returns a list of Map<String, Object> values for each row in the query, with the variable name as the key.- Since:
- 5.1.0
-
queryForMaps
EXPERIMENTAL: Returns a list of Map<String, Object> values for each row in the query, with the variable name as the key. -
isTrue
EXPERIMENTAL: Returns true if the query produces a row and false if the query produces no rows. If the query produces more than one row an exception is thrown. -
isTrue
EXPERIMENTAL: Returns true if the query produces a row and false if the query produces no rows. If the query produces more than one row an exception is thrown. -
queryForString
EXPERIMENTAL: Returns a String from the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
queryForString
EXPERIMENTAL: Returns a String from the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
queryForTopic
EXPERIMENTAL: Returns a topic from the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
queryForTopic
EXPERIMENTAL: Returns a topic from the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
queryForObject
EXPERIMENTAL: Returns the value in the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
queryForObject
EXPERIMENTAL: Returns the mapping of the value in the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
queryForObject
EXPERIMENTAL: Returns the value in the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
queryForObject
EXPERIMENTAL: Returns the mapping of the value in the first column in the first row of the query result. If the query produces no results null is returned. If the query produces more than one row or more than one column, an exception is thrown. -
update
EXPERIMENTAL: Runs an update statement, returning the number of changed rows. Makes no attempt to handle transactions, as this is an application issue.- Since:
- 5.1.1
-
update
EXPERIMENTAL: Runs an update statement, returning the number of changed rows. Makes no attempt to handle transactions, as this is an application issue.- Since:
- 5.1.1
-