Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

oracle.javatools.db.dictionary
Interface DictionaryQueries


public interface DictionaryQueries

A DictionaryQueries object is used by a DictionaryDatabase for retrieving any queries to the dictionary needed for the basic provider support of listing objects.

Since:
11.0

Nested Class Summary
static class DictionaryQueries.Params
          Enumeration of possible parameters that can be used in the list queries.
 
Method Summary
 boolean canUnionListQueries()
          Returns true if, when querying multiple object types, the DictionaryDatabase can UNION together all the list queries to speed up the query process.
 java.lang.String getAliveTestStatement()
          Returns the statement to execute when testing a connection is alive to the database.
 java.lang.String getCustomListQuery(java.lang.String type, boolean defaultSchema, java.lang.String schemaName)
          Returns the custom list query for the given object type.
 DictionaryQueries.Params[] getCustomListQueryParams(java.lang.String type, boolean defaultSchema, java.lang.String schemaName)
          Returns the parameters for the custom list query.
 java.lang.String getExistsQuery(java.lang.String type)
          Gets a query for finding out whether a partiulcar object (name, type, schema) exists.
 DictionaryQueries.Params[] getExistsQueryParams(java.lang.String type)
          If an exists query exists, this method must return the parameters that query requires.
 java.lang.String getObjectQueryByID(java.lang.String type)
          Returns the query used to retrieve an object's owner and name from the identifier.
 java.lang.String getSchemasQuery()
          Returns the query to retrieve a list of available schema names.
 java.lang.String getStandardListQuery(java.lang.String[] types)
          Returns the standard list query to use for any type that is supported by the database (has a builder registered) and is not defined as having a custom list query.
 DictionaryQueries.Params[] getStandardListQueryParams()
          Returns the parameters expected for the standard list query.
 java.lang.String getTimestampQueryByID()
          Returns the query to retrieve the timestampt for an object by its identifier from the database.
 java.lang.String getTimestampQueryByName(java.lang.String type)
          Returns the query to retrieve the timestamp for an object of given type from the database.
 boolean isCustomListQuery(java.lang.String type, boolean defaultSchema, java.lang.String schemaName)
          Returns true if the given type has a custom list query - i.e.
 

Method Detail

getStandardListQuery

java.lang.String getStandardListQuery(java.lang.String[] types)
Returns the standard list query to use for any type that is supported by the database (has a builder registered) and is not defined as having a custom list query.

The types are provided so that the standard query can be customised, if necessary. Substitution of the types at this stage is not recommended - use the TYPES or ALL_TYPES Param to do this.

This method can only safely return null if every object type that has a registered builder is defined as having a custom list query.

See Also:
isCustomListQuery(java.lang.String, boolean, java.lang.String), getStandardListQueryParams()

getStandardListQueryParams

DictionaryQueries.Params[] getStandardListQueryParams()
Returns the parameters expected for the standard list query.

For example, if the standard list query use bind variables and was:

  SELECT OBJECT_NAME, OBJECT_TYPE, OBJECT_ID FROM ALL OBJECTS
  WHERE OWNER = ? AND OBJECT_NAME LIKE ?
 
Then the parameters would be SCHEMA, NAMEREF.

Another example, using message format:

  SELECT OBJECT_NAME, OBJECT_TYPE, OBJECT_ID FROM ALL OBJECTS
  WHERE OWNER = ''{0}'' AND OBJECT_NAME LIKE ''{1}''
    AND OBJECT_TYPE IN (''{2}'')
 
Then the parameters would be SCHEMA, NAMEREF, TYPES

See Also:
getStandardListQuery(java.lang.String[])

isCustomListQuery

boolean isCustomListQuery(java.lang.String type,
                          boolean defaultSchema,
                          java.lang.String schemaName)
Returns true if the given type has a custom list query - i.e. cannot be queried using the "standard" query. The extra boolean parameter customises this further and allows custom list queries specifically when querying the non-default schema (e.g. for Oracle a schema other than the login user's).

See Also:
getCustomListQuery(java.lang.String, boolean, java.lang.String), #getStandardQuery

getCustomListQuery

java.lang.String getCustomListQuery(java.lang.String type,
                                    boolean defaultSchema,
                                    java.lang.String schemaName)
Returns the custom list query for the given object type.

See Also:
isCustomListQuery(java.lang.String, boolean, java.lang.String), getCustomListQueryParams(java.lang.String, boolean, java.lang.String)

getCustomListQueryParams

DictionaryQueries.Params[] getCustomListQueryParams(java.lang.String type,
                                                    boolean defaultSchema,
                                                    java.lang.String schemaName)
Returns the parameters for the custom list query. Normally SCHEMA and NAMEREF are all that is required here.

See Also:
getCustomListQuery(java.lang.String, boolean, java.lang.String)

canUnionListQueries

boolean canUnionListQueries()
Returns true if, when querying multiple object types, the DictionaryDatabase can UNION together all the list queries to speed up the query process.


getTimestampQueryByName

java.lang.String getTimestampQueryByName(java.lang.String type)
Returns the query to retrieve the timestamp for an object of given type from the database.

The query should take up to three parameters in the given order - schema, object name and object type. It should return one row, with one column, whose value is a valid java.sql.Timestamp.

Returns null if timestamps are not supported.


getTimestampQueryByID

java.lang.String getTimestampQueryByID()
Returns the query to retrieve the timestampt for an object by its identifier from the database.

The query should take one parameter which is the identifier returned as the 3rd column by any of the list queries. It should return one row, with one column, whose value is a valid java.sql.Timestamp.

Returns null if timestamps and/or identifiers are no supported.


getSchemasQuery

java.lang.String getSchemasQuery()
Returns the query to retrieve a list of available schema names.


getExistsQuery

java.lang.String getExistsQuery(java.lang.String type)
Gets a query for finding out whether a partiulcar object (name, type, schema) exists. The object type is given incase the queries for different types are different.
If no query is returned the standard getObject method is used to test for existence.


getExistsQueryParams

DictionaryQueries.Params[] getExistsQueryParams(java.lang.String type)
If an exists query exists, this method must return the parameters that query requires.


getObjectQueryByID

java.lang.String getObjectQueryByID(java.lang.String type)
Returns the query used to retrieve an object's owner and name from the identifier. Returns null if this database doesn't support identifiers.


getAliveTestStatement

java.lang.String getAliveTestStatement()
Returns the statement to execute when testing a connection is alive to the database.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

Copyright © 1997, 2009, Oracle. All rights reserved.