com.ibm.pdq.runtime.factory
Class DataFactory

java.lang.Object
  extended by com.ibm.pdq.runtime.factory.DataFactory

public class DataFactory
extends Object

Creates and returns instances of implementations of the Data interface and of interfaces that contain pureQuery annotated methods.

To use the pureQuery inline programming style, the DataFactory can be used to create instances of Data, and then the various inline methods can be called on the returned instance. To use the pureQuery annotated-method programming style, the user must first create an interface and generate an implementation class for the interface by using the pureQuery Generator. Then, the DataFactory interface can be used to create an instance of the interface that uses the generated implementation. The returned instance also implements the Data interface. See the IBM Optim pureQuery Runtime documentation for more information on using the inline programming style and the annotated-method programming style.

The Data instances that are returned from DataFactory methods can perform queries over a particular data source. The data source can be specified explicitly when the DataFactory method is called by specifying a Connection or a DataSource. If no data source is specified, the returned instance performs queries against in-memory collections (queries over collections). See the IBM Optim pureQuery Runtime documetation for more information on running queries against databases and against in-memory collections.

A Data instance that is returned from a DataFactory method can be assigned a Hook object that implements the Hook interface, if the Hook object is specified as a parameter to the DataFactory method. Doing so causes the Hook object's Hook.pre and Hook.post methods to bracket the execution of the inline or annotated methods that are called on the returned Data instance.

A Data instance that is returned from a DataFactory method can be assigned a Map of SQL overrides to be used for overriding the SQL statements that are executed by the methods of the Data interface. This can be done by specifying the Map as a parameter to the DataFactory method. The specified Map needs to have SQL expressions as keys and as values. When methods of the Data interface are called, if the SQL statement exactly matches one of the keys in the Map of SQL overrides, then the SQL expression that is the value for that key is executed instead. The SQL keys must exactly match the SQL to be executed by a method, including identical capitalization and white space.

See Also:
Data

Field Summary

Modifier and Type Field and Description
static boolean isInitialized
           

Constructor Summary

Constructor and Description
DataFactory()
           

Method Summary

Modifier and Type Method and Description
static Data getData()
          Returns an instance of a class that implements the Data interface for queries over collections.
static
<T> T
getData(Class<T> interfaceClass)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections.
static
<T> T
getData(Class<T> interfaceClass, Connection connection)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, Connection connection, Hook hook)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, Connection connection, Hook hook, Map<Object,Object> sqlOverrides)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, Connection connection, Hook hook, Properties properties)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, Connection connection, Map<Object,Object> sqlOverrides)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, Connection connection, Properties properties)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, Data data)
          Returns an instance of a class that implements the two interfaces interfaceClass and Data.
static
<T> T
getData(Class<T> interfaceClass, DataSource ds)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, DataSource ds, Hook hook)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, DataSource ds, Hook hook, Map<Object,Object> sqlOverrides)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, DataSource ds, Hook hook, Properties properties)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, DataSource ds, Map<Object,Object> sqlOverrides)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, DataSource ds, Properties properties)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static
<T> T
getData(Class<T> interfaceClass, Hook hook)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections.
static
<T> T
getData(Class<T> interfaceClass, Hook hook, Map<Object,Object> sqlOverrides)
          Returns an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections.
static Data getData(Connection connection)
          Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(Connection connection, Hook hook)
          Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(Connection connection, Hook hook, Map<Object,Object> sqlOverrides)
          Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(Connection connection, Hook hook, Properties properties)
          Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(Connection connection, Map<Object,Object> sqlOverrides)
          Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(Connection connection, Properties properties)
          Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(DataSource ds)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(DataSource ds, Hook hook)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(DataSource ds, Hook hook, Map<Object,Object> sqlOverrides)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(DataSource ds, Hook hook, Properties properties)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(DataSource ds, Map<Object,Object> sqlOverrides)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(DataSource ds, Properties properties)
          Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static.
static Data getData(Hook hook)
          Returns an instance of a class that implements the Data interface for queries over collections.
static Data getData(Hook hook, Map<Object,Object> sqlOverrides)
          Returns an instance of a class that implements the Data interface for queries over collections.

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

isInitialized

public static boolean isInitialized

Constructor Detail

DataFactory

public DataFactory()

Method Detail

getData

public static Data getData()
Returns an instance of a class that implements the Data interface for queries over collections.
Returns:
an instance of a class that implements the Data interface for queries over collections

getData

public static <T> T getData(Class<T> interfaceClass)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Connection connection)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
connection - the Connection to the database to use for queries, updates, and so on
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Connection connection,
                            Hook hook)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
connection - the Connection to the database to use for queries, updates, and so on
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Connection connection,
                            Hook hook,
                            Map<Object,Object> sqlOverrides)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
connection - the Connection to the database to use for queries, updates, and so on
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Connection connection,
                            Hook hook,
                            Properties properties)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
connection - the Connection to the database to use for queries, updates, and so on
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Connection connection,
                            Map<Object,Object> sqlOverrides)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
connection - the Connection to the database to use for queries, updates, and so on
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Connection connection,
                            Properties properties)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
connection - the Connection to the database to use for queries, updates, and so on
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Data data)
Returns an instance of a class that implements the two interfaces interfaceClass and Data. The passed-in instance data will be used for the implementation of Data.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
data - an implementtion of the Data interface that is used for the implementation of Data in the instance to return
Returns:
an instance of a class that implements the two interfaces interfaceClass and Data. The passed-in instance data will be used for the implementation of Data.
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            DataSource ds)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
ds - the DataSource against which the SQL statements are performed
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            DataSource ds,
                            Hook hook)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
ds - the DataSource against which the SQL statements are performed
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            DataSource ds,
                            Hook hook,
                            Map<Object,Object> sqlOverrides)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
ds - the DataSource against which the SQL statements are performed
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            DataSource ds,
                            Hook hook,
                            Properties properties)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
ds - the DataSource against which the SQL statements are performed
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            DataSource ds,
                            Map<Object,Object> sqlOverrides)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
ds - the DataSource against which the SQL statements are performed
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            DataSource ds,
                            Properties properties)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
ds - the DataSource against which the SQL statements are performed
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Hook hook)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections
See Also:
Data, Hook

getData

public static <T> T getData(Class<T> interfaceClass,
                            Hook hook,
                            Map<Object,Object> sqlOverrides)
Returns an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections.

If the pureQuery Generator is not used to create an implementation class for the interface interfaceClass, or if the implementation class is not accessible and instantiable, an Exception occurs because instantiating the class is impossible.

Type Parameters:
T - the interface that is specified as interfaceClass. The returned class instance implements this interface.
Parameters:
interfaceClass - the interface for which an instance of an implementation class is created. The pureQuery Generator must be used to create an implementation class for this interface, and the generated implementation class must be accessible and instantiable. If this is not the case, an Exception occurs because instantiating the class is impossible.
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements both the interfaceClass interface and the Data interface for queries over collections
See Also:
Data, Hook

getData

public static Data getData(Connection connection)
Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.
Parameters:
connection - the Connection to the database to use for queries, updates, and so on
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data

getData

public static Data getData(Connection connection,
                           Hook hook)
Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.
Parameters:
connection - the Connection to the database to use for queries, updates, and so on
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static Data getData(Connection connection,
                           Hook hook,
                           Map<Object,Object> sqlOverrides)
Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.
Parameters:
connection - the Connection to the database to use for queries, updates, and so on
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static Data getData(Connection connection,
                           Hook hook,
                           Properties properties)
Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.
Parameters:
connection - the Connection to the database to use for queries, updates, and so on
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static Data getData(Connection connection,
                           Map<Object,Object> sqlOverrides)
Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.
Parameters:
connection - the Connection to the database to use for queries, updates, and so on
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data

getData

public static Data getData(Connection connection,
                           Properties properties)
Returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection connection is the Connection of the new instance.
Parameters:
connection - the Connection to the database to use for queries, updates, and so on
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data

getData

public static Data getData(DataSource ds)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.
Parameters:
ds - the DataSource against which the SQL statements are performed
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static Data getData(DataSource ds,
                           Hook hook)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.
Parameters:
ds - the DataSource against which the SQL statements are performed
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static Data getData(DataSource ds,
                           Hook hook,
                           Map<Object,Object> sqlOverrides)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.
Parameters:
ds - the DataSource against which the SQL statements are performed
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static Data getData(DataSource ds,
                           Hook hook,
                           Properties properties)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.
Parameters:
ds - the DataSource against which the SQL statements are performed
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data, Hook

getData

public static Data getData(DataSource ds,
                           Map<Object,Object> sqlOverrides)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.
Parameters:
ds - the DataSource against which the SQL statements are performed
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data

getData

public static Data getData(DataSource ds,
                           Properties properties)
Establishes a Connection to the DataSource ds, if possible, and if a Connection is established, returns an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static. The Connection is the Connection of the new instance. If a Connection cannot be established, then a RuntimeException will be thrown.
Parameters:
ds - the DataSource against which the SQL statements are performed
properties - An instance of Properties that can provide values of one or more of the properties pdq.executionMode, pdq.queryTimeoutInSeconds, and pdq.maxResultRows for the created instance of Data. Any values specified for these properties here override any other values specified for these properties elsewhere. See the IBM Optim pureQuery Runtime documentation for information on how to set these properties.
Returns:
an instance of a class that implements the Data interface, with an implementation that is based on whether the execution mode is dynamic or static
See Also:
Data

getData

public static Data getData(Hook hook)
Returns an instance of a class that implements the Data interface for queries over collections.
Parameters:
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
Returns:
an instance of a class that implements the Data interface for queries over collections
See Also:
Data, Hook

getData

public static Data getData(Hook hook,
                           Map<Object,Object> sqlOverrides)
Returns an instance of a class that implements the Data interface for queries over collections.
Parameters:
hook - an implementation of the Hook interface to assign to the created instance of an implementation of Data
sqlOverrides - a Map of overrides, with SQL expressions as keys and the expressions to use instead of the original SQL expressions as values. When this method is used with the Data API, all of the SQL strings that are passed in as parameters are checked against the Map and are replaced when they are found in the Map. The purpose of the comparison is to see whether the String keys exactly match the SQL Strings. Any difference between two Strings, including a difference in white space or a difference in capitalization, results in the two Strings not matching each other.
Returns:
an instance of a class that implements the Data interface for queries over collections
See Also:
Data, Hook