Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.server
Class OracleSQLBuilderImpl

java.lang.Object
  extended byoracle.jbo.server.BaseSQLBuilderImpl
      extended byoracle.jbo.server.OracleSQLBuilderImpl
All Implemented Interfaces:
SQLBuilder, ViewCriteriaAdapter

public class OracleSQLBuilderImpl
extends BaseSQLBuilderImpl

Oracle-specific implementation of the SQLBuilder interface.

Since:
JDeveloper 3.0

Field Summary
protected static java.lang.String ORACLE_ROWID_COLUMN
           
 
Fields inherited from interface oracle.jbo.server.SQLBuilder
BINDING_STYLE_JDBC, BINDING_STYLE_ORACLE, BINDING_STYLE_UNKNOWN, DML_DELETE, DML_INSERT, DML_UPDATE
 
Constructor Summary
protected OracleSQLBuilderImpl()
          This is a singleton class
 
Method Summary
protected static java.lang.String addSqlTypeText(java.lang.String sqlText, java.lang.String inputType)
          helper for getTableList
 int bindInsertStatement(EntityImpl entityContext, java.sql.PreparedStatement stmt, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, com.sun.java.util.collections.HashMap retrList, boolean batchMode)
          DOCTD: Method declaration
 int bindUpdateStatement(EntityImpl entityContext, java.sql.PreparedStatement stmt, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, com.sun.java.util.collections.HashMap retrList, boolean batchMode)
          DOCTD: Method declaration
protected  int bindWhereAttrValue(EntityImpl entityContext, DBTransactionImpl trans, java.sql.PreparedStatement stmt, AttributeDefImpl attrDef, int bindIndex, boolean skipNull)
           
 java.lang.StringBuffer buildDeleteStatement(EntityImpl entityContext)
          Construct a SQL INSERT statement
 java.lang.StringBuffer buildInsertStatement(EntityImpl entityContext, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, boolean batchMode)
          Construct a SQL INSERT statement
 void buildOptUpdateWhereClause(EntityImpl entityContext, java.lang.StringBuffer buffer, AttributeDefImpl[] cols)
           
protected  void buildReturningClause(java.lang.StringBuffer sqlBuffer, DBTransactionImpl trans, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, boolean batchMode, boolean oracleBinding)
           
 void buildSelectString(DBTransactionImpl trans, java.lang.StringBuffer buffer, java.lang.String sourceName, java.lang.String sourceAlias, AttributeDefImpl[] attrs, boolean withIntoClause, int bindingStyle)
          Construct a SQL SELECT statement for the Entity into the designated Buffer.
 java.lang.StringBuffer buildUpdateStatement(EntityImpl entityContext, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, boolean batchMode)
          DOCTD: Method declaration TODO: KM _ don't like the fact that this requires an entitydef
 void buildWhereClause(EntityImpl entityContext, java.lang.StringBuffer buffer, AttributeDefImpl[] keyCols, java.lang.Object rowid)
          Construct a SQL WHERE clause for the Entity into the designated Buffer, based upon the Source Columns.
 boolean compareFetchedValue(EntityImpl entity, AttributeDefImpl ad, java.lang.Object cacheValue, java.lang.Object fetchedValue)
          Override for Oracle because in OracleDB, in cache we may have "" string that was posted and DB assumes that string as null and returns null on fetch again.
 java.lang.Object convertValueToStorageType(java.lang.Object value)
          Abstraction to allow domain types to be not converted if they're jdbc known types.
 void doEntityDML(EntityImpl entityContext, int operation, TransactionEvent e)
          This is where an entity DML gets executed.
 void doEntitySelect(EntityImpl entityContext, boolean lock)
          Perform the appropriate SQL operations to execute a select operation on an Entity Object.
 java.lang.Object[] doLoadBulkFromResultSet(AttributeDefImpl[] attrDefs, int attrIndex, java.sql.ResultSet rs, int index, DBTransactionImpl trans)
          Loads an array of objects from a result set.
 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.Object doLoadFromStatement(java.lang.Object theTypeFactory, java.lang.Object theElemFactory, java.lang.Class theJavaType, java.sql.PreparedStatement ps, int index, Transaction trans)
          Loads an object from a result set.
 void doPreparedStatementDefineColumnType(java.sql.PreparedStatement ps, int colnum, int sqltype)
          Performs the equivalent of defineColumnType() on a prepared statement.
 void doPreparedStatementDefines(java.sql.PreparedStatement stmt, AttributeDefImpl[] columns)
          Performs the equivalent of clearDefines() on a prepared statement.
 void doStatementSetBindingStyle(java.sql.Statement ps, int bindingStyle)
          Sets the binding style for the statement.
 void doStatementSetBindingStyleDefault(java.sql.Statement ps)
           
 void doStatementSetRowPrefetch(java.sql.Statement ps, int prefetchSize)
          Performs the equivalent of setRowPrefetch() on a statement.
 void executeBatch(java.sql.PreparedStatement stmt)
           
 java.lang.Object generatePKBasedRef(EntityImpl entityContext)
          Initial (temporay) value for ROWID, so that entity can be added in cache TODO: this is an awkward piece of non-generic JDBC - not sure how to emulate rowids in the generic case
 java.lang.Object[] generateRefAndOID(EntityImpl entityContext)
          Generates an object Ref and OID for an Entity Object.
 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
 com.sun.java.util.collections.ArrayList getConstraintsList(java.sql.Connection conn, java.lang.String catalog, java.lang.String schema, java.lang.String table)
          return vector of with constraint details for this table where each detail is in a String array with this structure: 0 String owner
 java.lang.String getCreateSequenceInsertTriggerSQL(java.lang.String triggerName, java.lang.String tableName, java.lang.String sequenceName, java.lang.String colName)
           
 java.lang.String getCreateSequenceSQL(java.lang.String sequenceName, int startVal)
           
 java.lang.String getDbTimeQuery()
           
 java.lang.String getDbType()
          returns a string uniquely identifying this type of SQLBuilder.
 int getDefaultBindingStyle()
          unless overridden, the binding style is set to JDBC (Oracle versions change this)
 java.lang.String getDropSequenceSQL(java.lang.String sequenceName)
           
 java.lang.String getDropTableSQL(java.lang.String dbObjectName)
           
protected  java.lang.String getFormattedLHSCompareFragment(AttributeDef attrDef, int sqltype, java.lang.String lhs, java.lang.Object rhs)
          Override this method to provide a formatted left-hand-comparator fragment of a comparision in a where clause for the given column.
protected  java.lang.String getFormattedLHSCompareFragment(ViewObject vo, ViewCriteria vc, AttributeDef attrDef, int sqltype, java.lang.String lhs, java.lang.Object rhs)
           
protected  java.lang.String getFormattedRHSCompareFragment(AttributeDef attrDef, int sqlType, java.lang.String rhs)
           
protected  java.lang.String getFormattedRHSCompareFragment(ViewObject vo, ViewCriteria vc, AttributeDef attrDef, int sqlType, java.lang.String rhs)
           
static SQLBuilder getInterface()
          Gets the singleton instance of this class.
protected  java.lang.String getJDBCDriverClassName()
          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.Object getROWID(EntityImpl entityContext)
          Get the ROWID attribute.
 java.util.Vector getSchemaList(java.sql.Connection connection)
          return a list of schemas for this database (note that for Oracle this is synonymous with users)
protected  java.lang.String getSqlVariantLockTrailer()
          This defines the string that will be post-fixed to SQL ststements to have the rows locked - if the DB is incapable of this then is should return null.
protected  java.lang.String getSqlVariantLockTrailer(EntityImpl entityContext)
           
protected static java.lang.String getTableListSqlStatement(java.lang.String defaultUserName, java.lang.String userName, boolean bTable, boolean bAlias, boolean bView, boolean bSnap, boolean bCount)
          helper for getTableList
 com.sun.java.util.collections.ArrayList getTables(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
 java.lang.String getTypeMapName()
          Returns a String identifying the preferred type map to use.
 java.lang.String getVersion()
          Gets a string describing the version of this implentation of this interface.
 boolean isConnectionAlive(java.sql.Connection conn)
           
 boolean isDataSourceJTABased(javax.sql.DataSource ds)
           
 boolean isDisplayBindValueUI()
           
 boolean isStreamType(int sqlTypeId)
          Provides streaming support.
 void jdbcClientSideSecurity(java.util.Properties info, java.util.Hashtable env)
           
 javax.sql.DataSource lookupDataSource(java.lang.String nsUrl, java.lang.String nsUser, java.lang.String nsPasswd, java.lang.String dataSourceName)
           
protected  boolean needsQuotedTableName(java.lang.String tableName)
           
 void releaseSavepoint(java.sql.Connection conn, java.lang.String id)
          release SAVEPOINT - if possible
 void rollbackToSavepoint(java.sql.Connection conn, java.lang.String id)
          rollback to SAVEPOINT - if possible
 void setSavepoint(java.sql.Connection conn, java.lang.String id)
          issue a SAVEPOINT - if possible
 boolean supportsReturningClause()
           
 boolean supportsRowNumQuery()
           
 
Methods inherited from class oracle.jbo.server.BaseSQLBuilderImpl
bindDeleteStatement, bindOptUpdateWhereClause, bindWhereClause, bindWhereClause, buildSelectString, capabilityCanReuseLockStatements, checkTableNameForQuotes, convertFlags, convertValueToWhereFragment, convertValueToWhereFragment, doRefreshSQL, doRegisterDefaultDriver, dumpConstraint, generateRowID, getColumnNameWithFormatForQuery, getConstraints, getCurrentDbTime, getLockTrailerIsAtEnd, getQueryHitCountSQL, getQuotationMarkLeft, getQuotationMarkRight, getSchemas, getSupportsAliasInUpdateStatements, getTableList, getViewCriteriaAdapter, getViewCriteriaClause, getWarningText, isCharType, isNumericType, populateJboTypeMapEntries, shouldSkipDML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORACLE_ROWID_COLUMN

protected static final java.lang.String ORACLE_ROWID_COLUMN
See Also:
Constant Field Values
Constructor Detail

OracleSQLBuilderImpl

protected OracleSQLBuilderImpl()
This is a singleton class

Method Detail

getInterface

public static SQLBuilder getInterface()
Gets the singleton instance of this class.


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()
Description copied from interface: SQLBuilder
Returns a String identifying the preferred type map to use.

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

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()
Description copied from class: BaseSQLBuilderImpl
unless overridden, the binding style is set to JDBC (Oracle versions change this)

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

executeBatch

public void executeBatch(java.sql.PreparedStatement stmt)
                  throws java.sql.SQLException
Specified by:
executeBatch in interface SQLBuilder
Overrides:
executeBatch in class BaseSQLBuilderImpl
Throws:
java.sql.SQLException

doEntityDML

public void doEntityDML(EntityImpl entityContext,
                        int operation,
                        TransactionEvent e)
This is where an entity DML gets executed.

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

doEntitySelect

public void doEntitySelect(EntityImpl entityContext,
                           boolean lock)
Description copied from interface: SQLBuilder
Perform the appropriate SQL operations to execute a select operation on an Entity Object.

Note: this method is subject to change.

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

doStatementSetRowPrefetch

public void doStatementSetRowPrefetch(java.sql.Statement ps,
                                      int prefetchSize)
                               throws java.sql.SQLException
Description copied from interface: SQLBuilder
Performs the equivalent of setRowPrefetch() on a statement.

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

doStatementSetBindingStyle

public void doStatementSetBindingStyle(java.sql.Statement ps,
                                       int bindingStyle)
Description copied from interface: SQLBuilder
Sets the binding style for the statement.

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

doStatementSetBindingStyleDefault

public void doStatementSetBindingStyleDefault(java.sql.Statement ps)
Specified by:
doStatementSetBindingStyleDefault in interface SQLBuilder
Overrides:
doStatementSetBindingStyleDefault in class BaseSQLBuilderImpl

doPreparedStatementDefineColumnType

public void doPreparedStatementDefineColumnType(java.sql.PreparedStatement ps,
                                                int colnum,
                                                int sqltype)
                                         throws java.sql.SQLException
Description copied from interface: SQLBuilder
Performs the equivalent of defineColumnType() on a prepared statement.

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

doPreparedStatementDefines

public void doPreparedStatementDefines(java.sql.PreparedStatement stmt,
                                       AttributeDefImpl[] columns)
Description copied from interface: SQLBuilder
Performs the equivalent of clearDefines() on a prepared statement.

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

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

doLoadBulkFromResultSet

public java.lang.Object[] doLoadBulkFromResultSet(AttributeDefImpl[] attrDefs,
                                                  int attrIndex,
                                                  java.sql.ResultSet rs,
                                                  int index,
                                                  DBTransactionImpl trans)
Description copied from interface: SQLBuilder
Loads an array of objects from a result set.

Note: this method is subject to change.

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

doLoadFromStatement

public java.lang.Object doLoadFromStatement(java.lang.Object theTypeFactory,
                                            java.lang.Object theElemFactory,
                                            java.lang.Class theJavaType,
                                            java.sql.PreparedStatement ps,
                                            int index,
                                            Transaction trans)
Description copied from interface: SQLBuilder
Loads an object from a result set.

Note: this method is subject to change.

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

setSavepoint

public void setSavepoint(java.sql.Connection conn,
                         java.lang.String id)
                  throws java.sql.SQLException
Description copied from interface: SQLBuilder
issue a SAVEPOINT - if possible

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

rollbackToSavepoint

public void rollbackToSavepoint(java.sql.Connection conn,
                                java.lang.String id)
                         throws java.sql.SQLException
Description copied from interface: SQLBuilder
rollback to SAVEPOINT - if possible

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

releaseSavepoint

public void releaseSavepoint(java.sql.Connection conn,
                             java.lang.String id)
                      throws java.sql.SQLException
Description copied from interface: SQLBuilder
release SAVEPOINT - if possible

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

supportsReturningClause

public boolean supportsReturningClause()
Specified by:
supportsReturningClause in interface SQLBuilder
Overrides:
supportsReturningClause in class BaseSQLBuilderImpl

supportsRowNumQuery

public boolean supportsRowNumQuery()
Specified by:
supportsRowNumQuery in interface SQLBuilder
Overrides:
supportsRowNumQuery in class BaseSQLBuilderImpl

buildUpdateStatement

public java.lang.StringBuffer buildUpdateStatement(EntityImpl entityContext,
                                                   AttributeDefImpl[] cols,
                                                   AttributeDefImpl[] retrCols,
                                                   AttributeDefImpl[] retrKeyCols,
                                                   boolean batchMode)
DOCTD: Method declaration TODO: KM _ don't like the fact that this requires an entitydef

Specified by:
buildUpdateStatement in interface SQLBuilder
Overrides:
buildUpdateStatement in class BaseSQLBuilderImpl
Parameters:
cols -
retrCols -
retrKeyCols -
Returns:
StringBuffer containing the DML for update

buildReturningClause

protected void buildReturningClause(java.lang.StringBuffer sqlBuffer,
                                    DBTransactionImpl trans,
                                    AttributeDefImpl[] retrCols,
                                    AttributeDefImpl[] retrKeyCols,
                                    boolean batchMode,
                                    boolean oracleBinding)

bindInsertStatement

public int bindInsertStatement(EntityImpl entityContext,
                               java.sql.PreparedStatement stmt,
                               AttributeDefImpl[] cols,
                               AttributeDefImpl[] retrCols,
                               AttributeDefImpl[] retrKeyCols,
                               com.sun.java.util.collections.HashMap retrList,
                               boolean batchMode)
                        throws java.sql.SQLException
DOCTD: Method declaration

Specified by:
bindInsertStatement in interface SQLBuilder
Overrides:
bindInsertStatement in class BaseSQLBuilderImpl
Parameters:
stmt -
cols -
retrCols -
retrKeyCols -
retrList -
Returns:
index of last bind variable set in this statement
Throws:
java.sql.SQLException

bindUpdateStatement

public int bindUpdateStatement(EntityImpl entityContext,
                               java.sql.PreparedStatement stmt,
                               AttributeDefImpl[] cols,
                               AttributeDefImpl[] retrCols,
                               AttributeDefImpl[] retrKeyCols,
                               com.sun.java.util.collections.HashMap retrList,
                               boolean batchMode)
                        throws java.sql.SQLException
DOCTD: Method declaration

Specified by:
bindUpdateStatement in interface SQLBuilder
Overrides:
bindUpdateStatement in class BaseSQLBuilderImpl
Parameters:
stmt -
cols -
retrCols -
retrKeyCols -
retrList -
Returns:
index of last bind variable set in this statement
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
Overrides:
bindWhereAttrValue in class BaseSQLBuilderImpl
Throws:
java.sql.SQLException

getROWID

protected java.lang.Object getROWID(EntityImpl entityContext)
Get the ROWID attribute. The ROWID attribute can be used to gain faster access to the underyling database data. Obtain the value for the ROWID attribute. If this entity doesn't support ROWID attributes, then return NULL. If, for some reason the value of the ROWID attribute isn't present, then return null.

Overrides:
getROWID in class BaseSQLBuilderImpl
Returns:
the value of the ROWID attribute or null if not present or applicable to this entity.

buildWhereClause

public void buildWhereClause(EntityImpl entityContext,
                             java.lang.StringBuffer buffer,
                             AttributeDefImpl[] keyCols,
                             java.lang.Object rowid)
Construct a SQL WHERE clause for the Entity into the designated Buffer, based upon the Source Columns. This routine will construct a SQL WHERE clause in the StringBuffer passed. It does this by appending the various components of the WHERE Clause (based upon Primary Key columns) into the buffer area.

For now it's private. We'll only consider it public when we sort out all of the issues with Sources/Sinks.

The presence or absence of the ROWID value determines whether the ROWID will be used for Row access.

Specified by:
buildWhereClause in interface SQLBuilder
Overrides:
buildWhereClause in class BaseSQLBuilderImpl
Parameters:
buffer - the area into which the WHERE Clause will be placed.
keyCols - the Primary key columns.
rowid - the ROWID for the ROW if known.

buildOptUpdateWhereClause

public void buildOptUpdateWhereClause(EntityImpl entityContext,
                                      java.lang.StringBuffer buffer,
                                      AttributeDefImpl[] cols)
Overrides:
buildOptUpdateWhereClause in class BaseSQLBuilderImpl

buildInsertStatement

public java.lang.StringBuffer buildInsertStatement(EntityImpl entityContext,
                                                   AttributeDefImpl[] cols,
                                                   AttributeDefImpl[] retrCols,
                                                   AttributeDefImpl[] retrKeyCols,
                                                   boolean batchMode)
Construct a SQL INSERT statement

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

buildDeleteStatement

public java.lang.StringBuffer buildDeleteStatement(EntityImpl entityContext)
Construct a SQL INSERT statement

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

buildSelectString

public void buildSelectString(DBTransactionImpl trans,
                              java.lang.StringBuffer buffer,
                              java.lang.String sourceName,
                              java.lang.String sourceAlias,
                              AttributeDefImpl[] attrs,
                              boolean withIntoClause,
                              int bindingStyle)
Construct a SQL SELECT statement for the Entity into the designated Buffer. This routine will construct a SQL SELECT statement in the StringBuffer passed. It does this by appending the various components of the SELECT statement into the buffer area.

Specified by:
buildSelectString in interface SQLBuilder
Overrides:
buildSelectString in class BaseSQLBuilderImpl
Parameters:
buffer - the area into which the SELECT statement will be placed.

generatePKBasedRef

public java.lang.Object generatePKBasedRef(EntityImpl entityContext)
Description copied from class: BaseSQLBuilderImpl
Initial (temporay) value for ROWID, so that entity can be added in cache TODO: this is an awkward piece of non-generic JDBC - not sure how to emulate rowids in the generic case

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

generateRefAndOID

public java.lang.Object[] generateRefAndOID(EntityImpl entityContext)
Description copied from interface: SQLBuilder
Generates an object Ref and OID for an Entity Object. This is used for an object table.

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

isStreamType

public boolean isStreamType(int sqlTypeId)
Description copied from interface: SQLBuilder
Provides streaming support.

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

getSchemaList

public java.util.Vector getSchemaList(java.sql.Connection connection)
                               throws java.lang.Exception
return a list of schemas for this database (note that for Oracle this is synonymous with users)

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

getTables

public com.sun.java.util.collections.ArrayList getTables(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

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

needsQuotedTableName

protected boolean needsQuotedTableName(java.lang.String tableName)
Overrides:
needsQuotedTableName in class BaseSQLBuilderImpl

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)
helper for getTableList


addSqlTypeText

protected static java.lang.String addSqlTypeText(java.lang.String sqlText,
                                                 java.lang.String inputType)
helper for getTableList


getConstraintsList

public com.sun.java.util.collections.ArrayList getConstraintsList(java.sql.Connection conn,
                                                                  java.lang.String catalog,
                                                                  java.lang.String schema,
                                                                  java.lang.String table)
                                                           throws java.sql.SQLException
Description copied from interface: SQLBuilder
return vector of with constraint details for this table where each detail is in a String array with this structure: 0 String owner

1 String constraint_name

2 String constraint_type

3 String table_name

4 String search_condition

5 Integer delete_rule (cascade)

6 Integer status (enabled)

7 Integerdeferrable

8 Integer deferred

9 Integer validated

10 String column_name

11 Integer position

12 String fkname

13 String fkother <>

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

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

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

getJDBCDriverClassName

protected java.lang.String getJDBCDriverClassName()
Description copied from class: BaseSQLBuilderImpl
Concrete implementations of SQLBuilder must elect a default driver name

Specified by:
getJDBCDriverClassName in class BaseSQLBuilderImpl

lookupDataSource

public javax.sql.DataSource lookupDataSource(java.lang.String nsUrl,
                                             java.lang.String nsUser,
                                             java.lang.String nsPasswd,
                                             java.lang.String dataSourceName)
                                      throws JboException
Specified by:
lookupDataSource in interface SQLBuilder
Overrides:
lookupDataSource in class BaseSQLBuilderImpl
Throws:
JboException

isDataSourceJTABased

public boolean isDataSourceJTABased(javax.sql.DataSource ds)
Specified by:
isDataSourceJTABased in interface SQLBuilder
Overrides:
isDataSourceJTABased in class BaseSQLBuilderImpl

getFormattedRHSCompareFragment

protected java.lang.String getFormattedRHSCompareFragment(AttributeDef attrDef,
                                                          int sqlType,
                                                          java.lang.String rhs)
Overrides:
getFormattedRHSCompareFragment in class BaseSQLBuilderImpl

getFormattedRHSCompareFragment

protected java.lang.String getFormattedRHSCompareFragment(ViewObject vo,
                                                          ViewCriteria vc,
                                                          AttributeDef attrDef,
                                                          int sqlType,
                                                          java.lang.String rhs)
Overrides:
getFormattedRHSCompareFragment in class BaseSQLBuilderImpl

getFormattedLHSCompareFragment

protected java.lang.String getFormattedLHSCompareFragment(AttributeDef attrDef,
                                                          int sqltype,
                                                          java.lang.String lhs,
                                                          java.lang.Object rhs)
Override this method to provide a formatted left-hand-comparator fragment of a comparision in a where clause for the given column.

Overrides:
getFormattedLHSCompareFragment in class BaseSQLBuilderImpl

getFormattedLHSCompareFragment

protected java.lang.String getFormattedLHSCompareFragment(ViewObject vo,
                                                          ViewCriteria vc,
                                                          AttributeDef attrDef,
                                                          int sqltype,
                                                          java.lang.String lhs,
                                                          java.lang.Object rhs)
Overrides:
getFormattedLHSCompareFragment in class BaseSQLBuilderImpl

getSqlVariantLockTrailer

protected java.lang.String getSqlVariantLockTrailer(EntityImpl entityContext)

getSqlVariantLockTrailer

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

Overrides:
getSqlVariantLockTrailer in class BaseSQLBuilderImpl

getDbTimeQuery

public java.lang.String getDbTimeQuery()
Specified by:
getDbTimeQuery in class BaseSQLBuilderImpl

getDropTableSQL

public java.lang.String getDropTableSQL(java.lang.String dbObjectName)
Specified by:
getDropTableSQL in interface SQLBuilder
Specified by:
getDropTableSQL in class BaseSQLBuilderImpl

isDisplayBindValueUI

public boolean isDisplayBindValueUI()
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)
Specified by:
getCreateSequenceInsertTriggerSQL in interface SQLBuilder
Specified by:
getCreateSequenceInsertTriggerSQL in class BaseSQLBuilderImpl

getCreateSequenceSQL

public java.lang.String getCreateSequenceSQL(java.lang.String sequenceName,
                                             int startVal)
Specified by:
getCreateSequenceSQL in interface SQLBuilder
Specified by:
getCreateSequenceSQL in class BaseSQLBuilderImpl

getDropSequenceSQL

public java.lang.String getDropSequenceSQL(java.lang.String sequenceName)
Specified by:
getDropSequenceSQL in interface SQLBuilder
Specified by:
getDropSequenceSQL in class BaseSQLBuilderImpl

isConnectionAlive

public boolean isConnectionAlive(java.sql.Connection conn)
Specified by:
isConnectionAlive in interface SQLBuilder
Overrides:
isConnectionAlive in class BaseSQLBuilderImpl

convertValueToStorageType

public java.lang.Object convertValueToStorageType(java.lang.Object value)
Abstraction to allow domain types to be not converted if they're jdbc known types.

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

jdbcClientSideSecurity

public void jdbcClientSideSecurity(java.util.Properties info,
                                   java.util.Hashtable env)
Specified by:
jdbcClientSideSecurity in interface SQLBuilder
Overrides:
jdbcClientSideSecurity in class BaseSQLBuilderImpl

compareFetchedValue

public boolean compareFetchedValue(EntityImpl entity,
                                   AttributeDefImpl ad,
                                   java.lang.Object cacheValue,
                                   java.lang.Object fetchedValue)
Override for Oracle because in OracleDB, in cache we may have "" string that was posted and DB assumes that string as null and returns null on fetch again. This method should return true for such cases.

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

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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