com.softwareag.tamino.db.api.accessor
Class TQueryBuilder

java.lang.Object
  extended by com.softwareag.tamino.db.api.accessor.TQueryBuilder

public class TQueryBuilder
extends java.lang.Object

TQueryBuilder is a helper class that can be used for building TQuery instances for often used query expressions. This class implements the singleton pattern, i.e. there is always only one instance of this class available.

Version:
$Revision: 1.5 $
Author:
Marcus Schreyer

Nested Class Summary
static class TQueryBuilder.TExplainLevel
          Enum class for the explanation level constants used with the TQueryBuilder.explain() method.
 
Constructor Summary
protected TQueryBuilder()
          Initializes the TQueryBuilder.
 
Method Summary
 TQuery buildFromDocname(java.lang.String doctype, java.lang.String docname)
          Builds a TQuery instance for a query expression to retrieve a single document based on its ino:docname.
 TQuery buildFromId(java.lang.String doctype, java.lang.String id)
          Builds a TQuery instance for a query expression to retrieve a single document based on its ino:id.
 TQuery explain(java.lang.String query)
          Builds a TQuery instance for a explain query with no explanation level.
 TQuery explain(java.lang.String query, TQueryBuilder.TExplainLevel explainLevel)
          Builds a TQuery instance for a explain query.
static TQueryBuilder getInstance()
          Gets the singleton instance of the TQueryBuilder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TQueryBuilder

protected TQueryBuilder()
Initializes the TQueryBuilder.

Method Detail

getInstance

public static TQueryBuilder getInstance()
Gets the singleton instance of the TQueryBuilder.

Returns:
the singleton TQueryBuilder instance.

buildFromId

public TQuery buildFromId(java.lang.String doctype,
                          java.lang.String id)
Builds a TQuery instance for a query expression to retrieve a single document based on its ino:id. The query expression generated has the following syntax:
 <doctype>[@ino:id="<id>"]
<\pre>

Parameters:
doctype - the doctype of the document to be retrieved.
id - the ino:id of the document to be retrieved.
Returns:
TQuery instance for the query expression.

buildFromDocname

public TQuery buildFromDocname(java.lang.String doctype,
                               java.lang.String docname)
Builds a TQuery instance for a query expression to retrieve a single document based on its ino:docname. The query expression generated has the following syntax:
 <doctype>[@ino:docname="<docname>"]
<\pre>

Parameters:
doctype - the doctype of the document to be retrieved.
docname - the ino:docname of the document to be retrieved.
Returns:
TQuery instance for the query expression.

explain

public TQuery explain(java.lang.String query)
Builds a TQuery instance for a explain query with no explanation level. This can be used to retrieve information about query execution for analysis and optimization. It returns information about the execution plan of the query wrapped up in a new element .

Parameters:
query - the query to explain.
Returns:
TQuery instance for the explain query expression.

explain

public TQuery explain(java.lang.String query,
                      TQueryBuilder.TExplainLevel explainLevel)
Builds a TQuery instance for a explain query. This can be used to retrieve information about query execution for analysis and optimization. It returns information about the execution plan of the query wrapped up in a new element .

Parameters:
query - the query to explain.
explainLevel - the level of explanation.
Returns:
TQuery instance for the explain query expression.


Copyright (c) 2013 Software AG. All Rights Reserved.