Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3)
B16005-01


oracle.jbo.server
Class OLiteSQLBuilderImpl

java.lang.Object
  extended byoracle.jbo.common.CommonCriteriaAdapter
      extended byoracle.jbo.server.BaseSQLBuilderImpl
          extended byoracle.jbo.server.OLiteSQLBuilderImpl

All Implemented Interfaces:
SQLBuilder, ViewCriteriaAdapter
Direct Known Subclasses:
WLSQLBuilderImpl

public class OLiteSQLBuilderImpl
extends BaseSQLBuilderImpl

OracleLite specific implementation of the SQLBuilder interface.

Since:
JDeveloper 3.0

Field Summary
static int ERROR_OLITE_RESOURCE_BUSY_AND_NOWAIT_SPECIFIED
          OLite specific error code for resource busy exception.
protected static java.lang.String ORACLE_ROWID_COLUMN
          Oracle specific column name for ROWID.

 

Fields inherited from interface oracle.jbo.server.SQLBuilder
BINDING_STYLE_JDBC, BINDING_STYLE_ORACLE, BINDING_STYLE_ORACLE_NAME, BINDING_STYLE_UNKNOWN, DML_DELETE, DML_INSERT, DML_UPDATE

 

Constructor Summary
protected OLiteSQLBuilderImpl()
          This is a singleton class.

 

Method Summary
protected static java.lang.String addSqlTypeText(java.lang.String sqlText, java.lang.String inputType)
          A helper method for getTableList.
protected  int bindWhereAttrValue(EntityImpl entityContext, DBTransactionImpl trans, java.sql.PreparedStatement stmt, AttributeDefImpl attrDef, int bindIndex, boolean skipNull)
          Binds an attribute value to the Statement's WHERE clause parameter index dealing with Null values appropriately.
protected  boolean capabilityCanReuseLockStatements()
          Cannot reuse lock statements for OLite database .
 java.lang.Object doLoadFromResultSet(java.lang.Object theTypeFactory, java.lang.Object theElemFactory, java.lang.Class theJavaType, byte attrLoad, java.sql.ResultSet rs, int index, DBTransactionImpl trans)
          Loads an object from a result set.
 java.lang.String getBaseTable(java.sql.Connection conn, java.lang.String schema, java.lang.String name)
          Unroll any synonyms that may be present, and get the real objectname.
 java.lang.String getCreateSequenceInsertTriggerSQL(java.lang.String triggerName, java.lang.String tableName, java.lang.String sequenceName, java.lang.String colName)
          This method is not implemented for OLite SQLBuilder.
 java.lang.String getCreateSequenceSQL(java.lang.String sequenceName, int startVal)
          This method is not implemented for OLite SQLBuilder.
 java.lang.String getDbTimeQuery()
          Returns a SQL statement to obtain the current time from the database.
 java.lang.String getDbType()
          Returns a string uniquely identifying this type of SQLBuilder.
 int getDefaultBindingStyle()
          Default binding style for this SQLBuilder is JDBC.
 java.lang.String getDropSequenceSQL(java.lang.String sequenceName)
          This method is not implemented for OLite SQLBuilder.
 java.lang.String getDropTableSQL(java.lang.String dbObjectName)
          Returns a SQL statement that drops a specified table.
static SQLBuilder getInterface()
          Gets the singleton instance of this class.
protected  java.lang.String getJDBCDriverClassName(java.lang.String url)
          Concrete implementations of SQLBuilder must elect a default driver name.
 java.lang.String getPersistManagerClassName()
          Returns the name of default PersistManager class name.
protected  java.lang.String getSqlVariantLockTrailer()
          This defines the string that will be post-fixed to SQL statements to have the rows locked - if the DB is incapable of this then it should return null.
 java.util.Vector getTableList(java.sql.Connection conn, java.lang.String defaultUserName, java.lang.String userName, boolean bTable, boolean bAlias, boolean bView, boolean bSnap)
          Return a list of tables visible in this connection.
protected static java.lang.String getTableListSqlStatement(java.lang.String _defaultUserName, java.lang.String userName, boolean bTable, boolean bAlias, boolean bView, boolean _bSnap, boolean bCount)
          A helper method for getTableListSqlStatement.
 java.lang.String getTypeMapName()
          The default type map for a OLite database is OLITE.
 java.lang.String getVersion()
          Gets a string describing the version of this implentation of this interface.
 boolean isDisplayBindValueUI()
          For Oracle database the test SQL wizards provide additional functionality to bind the parameters with test values.

 

Methods inherited from class oracle.jbo.server.BaseSQLBuilderImpl
baseBuildSelectList, bindDeleteStatement, bindInsertStatement, bindOptUpdateWhereClause, bindParametersForStmt, bindParamValue, bindUpdateStatement, bindWhereClause, bindWhereClause, buildDeleteStatement, buildInsertStatement, buildOptUpdateWhereClause, buildSelectList, buildSelectString, buildSelectString, buildUpdateStatement, buildWhereClause, checkTableNameForQuotes, compareFetchedValue, convertFlags, convertValueToStorageType, convertValueToWhereFragment, convertValueToWhereFragment, createHandleForCancellableStatements, doEntityDML, doEntitySelect, doLoadBulkFromResultSet, doLoadFromStatement, doPreparedStatementDefineColumnType, doPreparedStatementDefines, doRefreshSQL, doRegisterDefaultDriver, doStatementSetBindingStyle, doStatementSetBindingStyleDefault, doStatementSetRowPrefetch, dumpConstraint, executeBatch, formatAttributeValue, generatePKBasedRef, generateRefAndOID, generateRowID, getColumnNameWithFormatForQuery, getConstraints, getConstraintsList, getCurrentDbTime, getFormattedLHSCompareFragment, getFormattedLHSCompareFragment, getFormattedLHSCompareFragment, getFormattedRHSCompareFragment, getFormattedRHSCompareFragment, getFormattedRHSCompareFragment, getLockTrailerIsAtEnd, getMaxTableNameLength, getNestedTables, getQueryHitCountSQL, getQuotationMarkLeft, getQuotationMarkRight, getROWID, getSchemaList, getSchemas, getSupportsAliasInUpdateStatements, getTableList, getTables, getTables, getViewCriteriaAdapter, getViewCriteriaClause, getWarningText, invalidDatumFactoryUsage, isConnectionAlive, isDataSourceJTABased, isNewLineAllowedInSQL, isStreamType, jdbcClientSideSecurity, lookupDataSource, needsQuotedTableName, populateJboTypeMapEntries, processException, releaseSavepoint, rollbackToSavepoint, setSavepoint, shouldSkipDML, supportsReturningClause, supportsRowNumQuery

 

Methods inherited from class oracle.jbo.common.CommonCriteriaAdapter
convertValueToWhereFragment, getCriteriaClause, isCharType, isNumericType

 

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

 

Methods inherited from interface oracle.jbo.server.SQLBuilder
isCharType, isNumericType

 

Field Detail

ERROR_OLITE_RESOURCE_BUSY_AND_NOWAIT_SPECIFIED

public static final int ERROR_OLITE_RESOURCE_BUSY_AND_NOWAIT_SPECIFIED
OLite specific error code for resource busy exception.
See Also:
Constant Field Values

ORACLE_ROWID_COLUMN

protected static final java.lang.String ORACLE_ROWID_COLUMN
Oracle specific column name for ROWID.
See Also:
Constant Field Values

Constructor Detail

OLiteSQLBuilderImpl

protected OLiteSQLBuilderImpl()
This is a singleton class.

Method Detail

getInterface

public static SQLBuilder getInterface()
Gets the singleton instance of this class.
Returns:
a SQLBuilder object.

getJDBCDriverClassName

protected java.lang.String getJDBCDriverClassName(java.lang.String url)
Description copied from class: BaseSQLBuilderImpl
Concrete implementations of SQLBuilder must elect a default driver name.
Specified by:
getJDBCDriverClassName in class BaseSQLBuilderImpl
Parameters:
url - JDBC Connection url.
Returns:
the default driver class name based on the url and database flavor.

getVersion

public java.lang.String getVersion()
Description copied from interface: SQLBuilder
Gets a string describing the version of this implentation of this interface.
Specified by:
getVersion in interface SQLBuilder
Specified by:
getVersion in class BaseSQLBuilderImpl

getDbType

public java.lang.String getDbType()
Description copied from interface: SQLBuilder
Returns a string uniquely identifying this type of SQLBuilder. Examples are: "Oracle", "OLite", "SQL92".
Specified by:
getDbType in interface SQLBuilder
Specified by:
getDbType in class BaseSQLBuilderImpl

getTypeMapName

public java.lang.String getTypeMapName()
The default type map for a OLite database is OLITE.
Specified by:
getTypeMapName in interface SQLBuilder
Specified by:
getTypeMapName in class BaseSQLBuilderImpl
Returns:
PropertyConstants.OLITE constant.

getPersistManagerClassName

public java.lang.String getPersistManagerClassName()
Description copied from interface: SQLBuilder
Returns the name of default PersistManager class name.
Specified by:
getPersistManagerClassName in interface SQLBuilder
Specified by:
getPersistManagerClassName in class BaseSQLBuilderImpl

getDefaultBindingStyle

public int getDefaultBindingStyle()
Default binding style for this SQLBuilder is JDBC.
Specified by:
getDefaultBindingStyle in interface SQLBuilder
Overrides:
getDefaultBindingStyle in class BaseSQLBuilderImpl
Returns:
a SQLBuilder.BINDING_STYLE_JDBC constant.

getTableList

public java.util.Vector getTableList(java.sql.Connection conn,
                                     java.lang.String defaultUserName,
                                     java.lang.String userName,
                                     boolean bTable,
                                     boolean bAlias,
                                     boolean bView,
                                     boolean bSnap)
                              throws java.lang.Exception
Description copied from interface: SQLBuilder
Return a list of tables visible in this connection. Invokes getTables(Connection, String, String, boolean, boolean, boolean, boolean).

Note: this method is subject to change.

Specified by:
getTableList in interface SQLBuilder
Overrides:
getTableList in class BaseSQLBuilderImpl
Throws:
java.lang.Exception

getTableListSqlStatement

protected static java.lang.String getTableListSqlStatement(java.lang.String _defaultUserName,
                                                           java.lang.String userName,
                                                           boolean bTable,
                                                           boolean bAlias,
                                                           boolean bView,
                                                           boolean _bSnap,
                                                           boolean bCount)
A helper method for getTableListSqlStatement. Generates the SQL statement for selecting different object types from the database.
Parameters:
_defaultUserName - the user name of the connection. This is will also be treated as the schema name for non-oracle databases.
userName - the user name for which the tables need to be listed.
bTable - flag to include Table objects in the list.
bAlias - flag to include Synonyms in the list - Oracle database only.
bView - flag to include View objects in the list.
_bSnap - flag to include Snapshot objects in the list.
bCount - flag to retrieve the number of objects that will be fetched based on the object type flags.
Returns:
a SQL Statement that could be used to fetch the list of objects from the database.

addSqlTypeText

protected static java.lang.String addSqlTypeText(java.lang.String sqlText,
                                                 java.lang.String inputType)
A helper method for getTableList. Adds a clause to select a different object type to the list.
Parameters:
sqlText - a String containing a list of object types included so far.
inputType - a new object type to be added to the list.
Returns:
an updated object type list.

getBaseTable

public java.lang.String getBaseTable(java.sql.Connection conn,
                                     java.lang.String schema,
                                     java.lang.String name)
                              throws java.sql.SQLException
Description copied from interface: SQLBuilder
Unroll any synonyms that may be present, and get the real objectname.

Note: this method is subject to change.

Specified by:
getBaseTable in interface SQLBuilder
Overrides:
getBaseTable in class BaseSQLBuilderImpl
Throws:
java.sql.SQLException

bindWhereAttrValue

protected int bindWhereAttrValue(EntityImpl entityContext,
                                 DBTransactionImpl trans,
                                 java.sql.PreparedStatement stmt,
                                 AttributeDefImpl attrDef,
                                 int bindIndex,
                                 boolean skipNull)
                          throws java.sql.SQLException
Description copied from class: BaseSQLBuilderImpl
Binds an attribute value to the Statement's WHERE clause parameter index dealing with Null values appropriately. The attribute value is not yet poupulated in the Entity definition it is fetched and then bound.
Overrides:
bindWhereAttrValue in class BaseSQLBuilderImpl
Parameters:
entityContext - the entity object.
trans - the transaction object.
stmt - the Statement object carrying out the SQL.
attrDef - the defintion of the attribute to which the value belongs.
bindIndex - the parameter index in the PreparedStatement.
skipNull - indicates if the null values need to be bound or skipped.
Returns:
a new bind index value so that this method can be invoked in a loop.
Throws:
java.sql.SQLException

capabilityCanReuseLockStatements

protected boolean capabilityCanReuseLockStatements()
Cannot reuse lock statements for OLite database .
Overrides:
capabilityCanReuseLockStatements in class BaseSQLBuilderImpl
Returns:
false.

doLoadFromResultSet

public java.lang.Object doLoadFromResultSet(java.lang.Object theTypeFactory,
                                            java.lang.Object theElemFactory,
                                            java.lang.Class theJavaType,
                                            byte attrLoad,
                                            java.sql.ResultSet rs,
                                            int index,
                                            DBTransactionImpl trans)
Description copied from interface: SQLBuilder
Loads an object from a result set.

Note: this method is subject to change.

Specified by:
doLoadFromResultSet in interface SQLBuilder
Overrides:
doLoadFromResultSet in class BaseSQLBuilderImpl

getSqlVariantLockTrailer

protected java.lang.String getSqlVariantLockTrailer()
Description copied from class: BaseSQLBuilderImpl
This defines the string that will be post-fixed to SQL statements to have the rows locked - if the DB is incapable of this then it should return null. Examples are: SQL Server - "WITH (HOLDLOCK)" Oracle - "FOR UPDATE NOWAIT"
Overrides:
getSqlVariantLockTrailer in class BaseSQLBuilderImpl
Returns:
the lock clause.

getDbTimeQuery

public java.lang.String getDbTimeQuery()
Description copied from class: BaseSQLBuilderImpl
Returns a SQL statement to obtain the current time from the database.
Specified by:
getDbTimeQuery in class BaseSQLBuilderImpl
Returns:
a String containing the SQL statement.

getDropTableSQL

public java.lang.String getDropTableSQL(java.lang.String dbObjectName)
Description copied from interface: SQLBuilder
Returns a SQL statement that drops a specified table. For Oracle database it also deletes the constraints for the table.

Note: this method is subject to change.

Specified by:
getDropTableSQL in interface SQLBuilder
Specified by:
getDropTableSQL in class BaseSQLBuilderImpl

isDisplayBindValueUI

public boolean isDisplayBindValueUI()
Description copied from interface: SQLBuilder
For Oracle database the test SQL wizards provide additional functionality to bind the parameters with test values. For other databases this functionality is not supported.
Specified by:
isDisplayBindValueUI in interface SQLBuilder
Specified by:
isDisplayBindValueUI in class BaseSQLBuilderImpl

getCreateSequenceInsertTriggerSQL

public java.lang.String getCreateSequenceInsertTriggerSQL(java.lang.String triggerName,
                                                          java.lang.String tableName,
                                                          java.lang.String sequenceName,
                                                          java.lang.String colName)
This method is not implemented for OLite SQLBuilder.
Specified by:
getCreateSequenceInsertTriggerSQL in interface SQLBuilder
Specified by:
getCreateSequenceInsertTriggerSQL in class BaseSQLBuilderImpl

getCreateSequenceSQL

public java.lang.String getCreateSequenceSQL(java.lang.String sequenceName,
                                             int startVal)
This method is not implemented for OLite SQLBuilder.
Specified by:
getCreateSequenceSQL in interface SQLBuilder
Specified by:
getCreateSequenceSQL in class BaseSQLBuilderImpl

getDropSequenceSQL

public java.lang.String getDropSequenceSQL(java.lang.String sequenceName)
This method is not implemented for OLite SQLBuilder.
Specified by:
getDropSequenceSQL in interface SQLBuilder
Specified by:
getDropSequenceSQL in class BaseSQLBuilderImpl

Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3)
B16005-01


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