Skip navigation links

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

E13403-06


oracle.javatools.db.dictionary
Class DictionaryQueries

java.lang.Object
  extended by oracle.javatools.db.dictionary.DictionaryQueries


public abstract class DictionaryQueries
extends java.lang.Object

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.

 

Field Summary
static DictionaryQueries.Params[] EMPTY_PARAMS
           

 

Constructor Summary
DictionaryQueries()
           

 

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, DBObjectCriteria criteria)
          Returns the custom list query for the given object type.
 DictionaryQueries.Params[] getCustomListQueryParams(java.lang.String type, boolean defaultSchema, DBObjectCriteria criteria)
          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 getObjectStatusQuery(java.lang.String objectType)
          Gets the query to test an object's status.
 DictionaryQueries.Params[] getObjectStatusQueryParams(java.lang.String type)
          Gets the parameters for the object status query for the given object type.
 java.lang.String getSchemasQuery()
          Deprecated. 
abstract  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.
abstract  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.
abstract  java.lang.String getUserNameQuery()
          Returns the name of the current user for this connection.
 boolean isCustomListQuery(java.lang.String type, boolean defaultSchema, DBObjectCriteria criteria)
          Returns true if the given type has a custom list query - i.e.

 

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

 

Field Detail

EMPTY_PARAMS

public static final DictionaryQueries.Params[] EMPTY_PARAMS

Constructor Detail

DictionaryQueries

public DictionaryQueries()

Method Detail

getStandardListQuery

public abstract 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, oracle.javatools.db.DBObjectCriteria), getStandardListQueryParams()

getStandardListQueryParams

public abstract 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

public boolean isCustomListQuery(java.lang.String type,
                                 boolean defaultSchema,
                                 DBObjectCriteria criteria)
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, oracle.javatools.db.DBObjectCriteria), #getStandardQuery

getCustomListQuery

public java.lang.String getCustomListQuery(java.lang.String type,
                                           boolean defaultSchema,
                                           DBObjectCriteria criteria)
Returns the custom list query for the given object type.
See Also:
isCustomListQuery(java.lang.String, boolean, oracle.javatools.db.DBObjectCriteria), getCustomListQueryParams(java.lang.String, boolean, oracle.javatools.db.DBObjectCriteria)

getCustomListQueryParams

public DictionaryQueries.Params[] getCustomListQueryParams(java.lang.String type,
                                                           boolean defaultSchema,
                                                           DBObjectCriteria criteria)
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, oracle.javatools.db.DBObjectCriteria)

canUnionListQueries

public 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

public 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

public 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

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

getUserNameQuery

public abstract java.lang.String getUserNameQuery()
Returns the name of the current user for this connection.

getExistsQuery

public 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

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

getObjectQueryByID

public 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

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

getObjectStatusQuery

public java.lang.String getObjectStatusQuery(java.lang.String objectType)
Gets the query to test an object's status. If no specific query exists, a check to see if the object simply exists is performed.
Parameters:
objectType - the object type to query
Returns:
the query for an object's status (or none if no specific query exists).

getObjectStatusQueryParams

public DictionaryQueries.Params[] getObjectStatusQueryParams(java.lang.String type)
Gets the parameters for the object status query for the given object type.
Parameters:
type - the object type the status query is for
Returns:
the params to the appropriate query from getObjectStatusQuery(String).

Skip navigation links

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

E13403-06


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