|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.6.0) E10653-07 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SQLBuilder
Internal: Applications should not use this interface.
Note: This interface is subject to change.
This interface is used by View Objects to construct SQL statements that create, retrieve, update and delete table rows based on the state of the cache.
Field Summary | |
---|---|
static int |
BINDING_STYLE_JDBC
Constant used to specify JDBC binding style while binding parameters to a statement object. |
static int |
BINDING_STYLE_ORACLE
Constant used to specify Oracle binding style while binding parameters to a statement object. |
static int |
BINDING_STYLE_ORACLE_NAME
Constant used to specify Oracle Named Parameter binding style while binding parameters to a statement object. |
static int |
BINDING_STYLE_UNKNOWN
Constant used to specify "Unknown" binding style while binding parameters to a statement object. |
static int |
DML_DELETE
Constant used to specify the DML mode to be DELETE. |
static int |
DML_INSERT
Constant used to specify the DML mode to be INSERT. |
static int |
DML_UPDATE
Constant used to specify the DML mode to be UPDATE. |
static int |
MAX_COLUMN_IDENTIFIER_LEN
|
static java.lang.String |
RANGE_PAGE_BIND_HIGH_ROWNUM
|
static java.lang.String |
RANGE_PAGE_BIND_LOW_ROWNUM
|
Method Summary | |
---|---|
int |
bindDeleteStatement(EntityImpl entityContext,
java.sql.PreparedStatement stmt)
Binds the values in the entity attribute storage with the DELETE statement. |
void |
bindEffDtDateDayAddStatement(java.sql.PreparedStatement stmt,
java.lang.Object date,
int days)
Bind the statement with the values required to compute a date that is 'x' number of days apart from the specified date |
int |
bindInsertStatement(EntityImpl entityContext,
java.sql.PreparedStatement stmt,
AttributeDefImpl[] cols,
AttributeDefImpl[] retrCols,
AttributeDefImpl[] retrKeyCols,
java.util.HashMap retrList,
boolean batchMode)
Binds the entity attribute storage with the parameters in the INSERT statement. |
void |
bindParametersForStmt(int bindingStyle,
java.lang.Object[] params,
java.sql.PreparedStatement stmt)
Bind parameter values for a SQL execution. |
void |
bindRangePagingParams(java.sql.PreparedStatement stmt,
ViewObjectImpl vo,
int nextParamIndex,
int rangeStart,
int rangeSize)
|
int |
bindUpdateStatement(EntityImpl entityContext,
java.sql.PreparedStatement stmt,
AttributeDefImpl[] cols,
AttributeDefImpl[] retrCols,
AttributeDefImpl[] retrKeyCols,
java.util.HashMap retrList,
boolean batchMode)
Binds the entity attribute storage with the parameters in the UPDATE statement. |
int |
bindWhereClause(EntityImpl entityContext,
java.sql.PreparedStatement stmt,
AttributeDefImpl[] retrKeyCols,
java.lang.Object rowid,
int bindIndex)
Bind the Primary key values for the designated Statement. |
int |
bindWhereClause(EntityImpl entityContext,
java.sql.PreparedStatement stmt,
java.lang.Object rowid,
int bindIndex)
Bind the Primary key values for the designated Statement. |
void |
buildDefaultViewObjectFromClause(java.lang.StringBuffer fromClause,
java.util.List eRefs)
Deprecated. since 11.1.1. use buildDefaultViewObjectFromClause with 3 parameters instead. |
void |
buildDefaultViewObjectFromClause(java.lang.StringBuffer fromClause,
java.util.List eRefs,
BaseViewCriteriaManagerImpl vcManager)
This method is used to generate the "from" clause if the following conditions are met: The View Object definition does not have an expert mode query The View Object definition is set to generate "from" clause during runtime, either in metadata or by calling ViewDefImpl.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT)
|
java.util.HashMap |
buildDefaultViewObjectWhereClause(java.lang.StringBuffer whereClause,
java.util.List eRefs,
java.util.List forcedERefs,
EntityReference[][] newEntRefsArr,
boolean isInlineViewForFroms)
This method is used to generate the "where" clause if the following conditions are met: The View Object definition does not specify "where" clause The View Object definition is set to generate "where" clause during runtime, either in metadata or by calling ViewDefImpl.setWhereClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT)
|
java.lang.StringBuffer |
buildDeleteStatement(EntityImpl entityContext)
Build a DELETE SQL for the Entity Object. |
java.lang.String |
buildEffDtDateDayAddStatement()
Returns a statement that returns a date that is 'x' number of days apart from the specified date. |
java.lang.StringBuffer |
buildInsertStatement(EntityImpl entityContext,
AttributeDefImpl[] cols,
AttributeDefImpl[] retrCols,
AttributeDefImpl[] retrKeyCols,
boolean batchMode)
Build a INSERT SQL for the Entity Object skipping non-persistent values. |
java.lang.String |
buildRangePagingQuery(ViewObjectImpl vo,
java.lang.String qry,
int noUserParams)
|
void |
buildSelectList(java.lang.StringBuffer buffer,
AttributeDefImpl[] attrs,
java.lang.String sourceAlias,
boolean forViewObject)
Build a list of columns that could be used in a SELECT statement. |
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)
Build a UPDATE SQL for the Entity Object skipping non-persistent values. |
void |
buildWhereClause(EntityImpl entityContext,
java.lang.StringBuffer buffer,
AttributeDefImpl[] keyCols,
java.lang.Object rowid)
Creates a WHERE clause containing the Primary Key columns passed to the method. |
java.lang.String |
checkTableNameForQuotes(java.lang.String tableName)
Add quotes to any table name that may need it. |
boolean |
compareFetchedValue(EntityImpl entity,
AttributeDefImpl ad,
java.lang.Object cacheValue,
java.lang.Object fetchedValue)
Compare the cacheValue with fetchedValue and if they are equal return true This API is used when comparing cached entity with a faulted in entity. |
boolean |
containsTableAlias(java.lang.String clause,
java.lang.String alias)
|
java.lang.Object |
convertValueToStorageType(java.lang.Object value)
This method is used to convert the Java type to a JDBC type so that it could be used to bind as a parameter for SQL execution. |
void |
doEntityDML(EntityImpl enrt,
int operation,
TransactionEvent e)
Performs the appropriate SQL Data Manipulation Language (DML) operations on the database to reflect an update, delete or insert operation on an Entity Object. |
void |
doEntitySelect(EntityImpl e,
boolean lock)
Perform the appropriate SQL operations to execute a select operation on an Entity Object. |
void |
doEntitySelectForAltKey(EntityImpl e,
int keyIndex,
boolean lock)
|
java.lang.Object[] |
doLoadBulkFromResultSet(AttributeDefImpl[] attrs,
int attrIndex,
java.sql.ResultSet rs,
int rsIndex,
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 ps,
AttributeDefImpl[] attrs)
Defines the column types of the attributes based on the meta-data. |
void |
doRefreshSQL(EntityImpl entityContext,
int operation,
AttributeDefImpl[] columns,
AttributeDefImpl[] keyCols)
Refreshes the entity after an update on the database. |
void |
doRegisterDefaultDriver(java.lang.String url)
Registers the JDBC driver associated with this type of JDBC connection. |
void |
doStatementSetBindingStyle(java.sql.Statement ps,
int bindingStyle)
Sets the binding style for the statement. |
void |
doStatementSetBindingStyleDefault(java.sql.Statement ps)
Sets the binding style to the default value of the database type. |
void |
doStatementSetRowPrefetch(java.sql.Statement ps,
int prefetchSize)
Performs the equivalent of setRowPrefetch() on a statement. |
void |
executeBatch(java.sql.PreparedStatement stmt)
Executes the PreparedStatement in batch mode. |
java.lang.Object |
generatePKBasedRef(EntityImpl entityContext)
Generates a PK-Based REF for an Entity Object. |
java.lang.Object[] |
generateRefAndOID(EntityImpl e)
Generates an object Ref and OID for an Entity Object. |
java.lang.Object |
generateRowID(EntityImpl e)
Get the ROWID attribute. |
java.util.ArrayList<ViewCriteria> |
getANSIJoinVCs(java.util.List eRefs)
|
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 |
getCappedQueryHitCountSQL(RowSet rs,
long cap)
|
java.lang.String |
getClauseForDateLiteral(java.util.Date date)
Creates a database platform specific clause for converting a date string literal to date datatype. |
java.util.Vector |
getConstraints(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Return vector with constraint details for this table. |
java.util.ArrayList |
getConstraintsList(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Return vector 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.util.ArrayList sequenceNames,
java.util.ArrayList colNames)
Returns a SQL statement that creates a trigger that updates a column with the value from a sequence upon the creation of a new row. |
java.lang.String |
getCreateSequenceSQL(java.lang.String sequenceName,
int startVal)
Returns a SQL statement that creates a Sequence with an initial value specified in the argument. |
java.sql.Timestamp |
getCurrentDbTime(java.sql.Connection conn)
Returns the current time from the Database. |
java.util.ArrayList |
getDBOperationList(java.sql.Connection connection,
java.lang.String userName,
java.lang.String packageFilter,
java.lang.String operationFilter)
Return a list of packages visible in this connection. |
java.util.ArrayList |
getDBPackageList(java.sql.Connection conn,
java.lang.String userName,
java.lang.String packageFilter)
Return a list of packages visible in this connection. |
java.lang.String |
getDbType()
Returns a string uniquely identifying this type of SQLBuilder. |
int |
getDefaultBindingStyle()
Returns a constant identifying the best binding style for this sort of SQL (see the BINDINGSTYLE constants). |
java.lang.String |
getDropSequenceSQL(java.lang.String sequenceName)
Returns a SQL statement that drops a specified Sequence. |
java.lang.String |
getDropTableSQL(java.lang.String dbObjectName)
Returns a SQL statement that drops a specified table. |
java.lang.String |
getEscapeClause(boolean forQuery)
Returns the escape clause to be used with LIKE wildcard character escaping. |
java.lang.String |
getFormattedLHSCompareFragment(ViewObject vo,
ViewCriteria vc,
AttributeDef attrDef,
int sqlType,
java.lang.String lhs,
java.lang.Object rhs)
This method provides a formatted left-hand-comparator fragment of a comparision in a where clause for the given column. |
java.lang.String |
getFormattedRHSCompareFragment(ViewObject vo,
ViewCriteria vc,
AttributeDef attrDef,
int sqlType,
java.lang.String rhs)
This method provides a formatted right-hand-comparator fragment of a comparision in a where clause for the given column. |
int |
getMaxTableNameLength(java.sql.Connection conn)
Return the maximum length of a table name for the Database connection. |
java.util.ArrayList |
getNestedTables(java.sql.Connection conn)
Returns a list of nested tables in this connection. |
java.lang.String |
getPersistManagerClassName()
Returns the name of default PersistManager class name. |
java.lang.String |
getQueryHitCountSQL(RowSet rs)
Returns a SQL statement to estimate the number of rows effected by the query using the rowset values. |
java.util.Vector |
getSchemaList(java.sql.Connection conn)
Return a list of schemas for this database (note that for Oracle this is synonymous with users) |
java.util.ArrayList |
getSchemas(java.sql.Connection conn)
Return a list of schemas for this database (note that for Oracle this is synonymous with users) |
java.lang.String |
getStringConcatOper(boolean bIncludeSpaces)
Returns a String concatenation operator for query clause generation. |
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. |
java.util.Vector |
getTableList(java.sql.Connection conn,
java.lang.String defaultUserName,
java.lang.String userName,
boolean bTable,
boolean bAlias,
boolean bView,
boolean bSnap,
boolean bIncludeNested)
Return a list of tables visible in this connection. |
java.util.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.util.ArrayList |
getTables(java.sql.Connection conn,
java.lang.String defaultUserName,
java.lang.String userName,
boolean bTable,
boolean bAlias,
boolean bView,
boolean bSnap,
boolean bIncludeNested)
Return a list of tables visible in this connection. |
java.util.ArrayList |
getTables(java.sql.Connection conn,
java.lang.String defaultUserName,
java.lang.String userName,
java.lang.String nameFilter,
boolean bTable,
boolean bAlias,
boolean bView,
boolean bSnap)
Return a list of tables visible in this connection. |
java.util.ArrayList |
getTables(java.sql.Connection conn,
java.lang.String defaultUserName,
java.lang.String userName,
java.lang.String nameFilter,
boolean bTable,
boolean bAlias,
boolean bView,
boolean bSnap,
boolean bIncludeNested)
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. |
ViewCriteriaAdapter |
getViewCriteriaAdapter()
Returns a ViewCriteriaAdapter for the SQLBuilder object. |
java.lang.String |
getWildCardEscapeVal(java.lang.String val,
boolean isBindVarVal,
boolean forQuery)
Process val and returns a substitued value to use in a SQL LIKE predicate to handle wildcard value escaping. |
void |
handleSQLException(JboSQLException jboSqlEx)
Performs extra processing before re-throwing JboSQLException . |
boolean |
invalidDatumFactoryUsage(java.lang.String colType,
int id,
java.lang.Class clz)
Returns false only for types where raw-bytes may be used to create the desired attribute values while fetching data from jdbc. |
boolean |
isCharType(int type)
Tests if a type is character. |
boolean |
isConnectionAlive(java.sql.Connection conn)
Detects if a connection is alive. |
boolean |
isDataSourceJTABased(javax.sql.DataSource ds)
Checks if the DataSource is JTA-enabled. |
boolean |
isDisplayBindValueUI()
For Oracle database the test SQL wizards provide additional functionality to bind the parameters with test values. |
boolean |
isNCharType(java.sql.Statement stmt,
int index)
Tests if the select statement at a given column index corresponds to an international character column. |
boolean |
isNewLineAllowedInSQL(java.sql.Connection conn)
Checks if the JDBC driver supports new line character in SQL statements. |
boolean |
isNumericType(int type)
Tests if a type is numeric. |
boolean |
isSQLRecoverableException(java.lang.Exception ex)
Checks if the exception is recoverable such that a retry after obtaining a new connection may succeed. |
boolean |
isStreamType(int sqlTypeId)
Check if a given type provides streaming support. |
void |
jdbcClientSideSecurity(java.util.Properties info,
java.util.Hashtable env)
Populates the properties with known security attributes found in the environment. |
javax.sql.DataSource |
lookupDataSource(java.lang.String nsUrl,
java.lang.String nsUser,
java.lang.String nsPasswd,
java.lang.String dataSourceName)
Performs a JNDI lookup for the datasource. |
void |
populateCompOpers()
|
void |
populateJboTypeMapEntries()
Populates the system typemap table with entries appropriate for the JDBC implementation. |
java.lang.String |
processClauseForSubQuery(java.lang.String clause,
EntityReference[] entRefs,
java.lang.String suffix,
boolean isSQLExpr,
boolean[] isModified)
|
java.lang.String |
processClauseReplaceTableAliases(java.lang.String clause,
RowReference[] origEntRefs,
RowReference[] newEntRefs,
boolean isSQLExpr,
boolean[] isModified)
|
void |
processException(java.lang.String errorCode,
java.lang.Exception sqlEx,
java.lang.Object[] params)
Handle SQL exceptions by wrapping into SQLStmtException
or JboException . |
ADFDatabaseChangeListener |
registerDatabaseChangeListener(QueryCollection listener,
java.sql.Connection conn,
java.sql.Statement stmt)
Register a Query Collection to listen to database data change events. |
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. |
void |
setSessionTimeZone(java.sql.Connection conn,
java.lang.String regionName)
Sets the user session timezone on the Connection object. |
boolean |
shouldPutJoinConstraintInFromClause()
Checks if the FROM clause allows view criteria. |
boolean |
supportsReturningClause()
Checks if the database supports the Returning clause. |
boolean |
supportsRowNumQuery()
Checks if the database supports "rownum" identifier. |
Field Detail |
---|
static final int DML_INSERT
doEntityDML(EntityImpl, int, TransactionEvent)
,
Constant Field Valuesstatic final int DML_UPDATE
doEntityDML(EntityImpl, int, TransactionEvent)
,
Constant Field Valuesstatic final int DML_DELETE
doEntityDML(EntityImpl, int, TransactionEvent)
,
Constant Field Valuesstatic final int BINDING_STYLE_UNKNOWN
doStatementSetBindingStyle(Statement, int)
,
Constant Field Valuesstatic final int BINDING_STYLE_JDBC
doStatementSetBindingStyle(Statement, int)
,
Constant Field Valuesstatic final int BINDING_STYLE_ORACLE
doStatementSetBindingStyle(Statement, int)
,
Constant Field Valuesstatic final int BINDING_STYLE_ORACLE_NAME
doStatementSetBindingStyle(Statement, int)
,
Constant Field Valuesstatic final int MAX_COLUMN_IDENTIFIER_LEN
static final java.lang.String RANGE_PAGE_BIND_LOW_ROWNUM
static final java.lang.String RANGE_PAGE_BIND_HIGH_ROWNUM
Method Detail |
---|
java.lang.String getVersion()
java.lang.String getDbType()
java.util.ArrayList getNestedTables(java.sql.Connection conn) throws java.sql.SQLException
Note: this method is subject to change.
conn
- the connection.
java.sql.SQLException
java.lang.String getTypeMapName()
java.lang.String getPersistManagerClassName()
int getDefaultBindingStyle()
Note: this method is subject to change.
void doRegisterDefaultDriver(java.lang.String url) throws java.sql.SQLException
url
- JDBC Connection url.
java.sql.SQLException
void doEntityDML(EntityImpl enrt, int operation, TransactionEvent e)
Note: this method is subject to change.
enrt
- the Entity Object.operation
- one of DML_INSERT, DML_UPDATE, or DML_DELETE.e
- the transaction.java.lang.StringBuffer buildInsertStatement(EntityImpl entityContext, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, boolean batchMode)
Note: this method is subject to change.
entityContext
- the entity object.cols
- the columns to be included in the INSERT statement.retrCols
- the Columns whose values need to be fetched after the INSERT succeeds.retrKeyCols
- the Columns that are used as Keys to fetch post-insert values.batchMode
- a flag to indicate if the INSERT statement needs to be optimized
for batch mode.
java.lang.StringBuffer buildUpdateStatement(EntityImpl entityContext, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, boolean batchMode)
Note: this method is subject to change.
entityContext
- the entity object.cols
- the columns to be included in the UPDATE statement.retrCols
- the Columns whose values need to be fetched after the UPDATE succeeds.retrKeyCols
- the Columns that are used as Keys to fetch post-update values.batchMode
- a flag to indicate if the UPDATE statement needs to be optimized
for batch mode.
java.lang.StringBuffer buildDeleteStatement(EntityImpl entityContext)
Note: this method is subject to change.
entityContext
- the entity object.
void buildSelectList(java.lang.StringBuffer buffer, AttributeDefImpl[] attrs, java.lang.String sourceAlias, boolean forViewObject)
Note: this method is subject to change.
buffer
- the StringBuffer object to which the SELECT list is appended.attrs
- the list of attribute definitions to be considered for the SELECT list.sourceAlias
- the database object name that contains the attributes.void buildSelectString(DBTransactionImpl trans, java.lang.StringBuffer buffer, java.lang.String sourceName, java.lang.String sourceAlias, AttributeDefImpl[] attrs, boolean withIntoClause, int bindingStyle)
Note: this method is subject to change.
trans
- a reference to the transaction object.buffer
- the StringBuffer object to which the SELECT statement is appended.sourceName
- the database object from which the Columns are selected.sourceAlias
- the database object alias.attrs
- the attributes that are selected from the database object.withIntoClause
- a boolean that indicates if an INTO Clause needs to be generated.bindingStyle
- specifies if Oracle, Oracle named parameter or JDBC binding style
is used in generating the parameter markers for the INTO clause.int bindInsertStatement(EntityImpl entityContext, java.sql.PreparedStatement stmt, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, java.util.HashMap retrList, boolean batchMode) throws java.sql.SQLException
Note: this method is subject to change.
entityContext
- the entity object.stmt
- the statement handle executing the INSERT statement.cols
- the columns involved in the INSERT statement.retrCols
- the columns whose values need to be fetched after a
successful insert.retrKeyCols
- the columns that act as a key to fetch the newly
inserted values.retrList
- a map containing the references to store the fetched
values.batchMode
- flag to indicate binding for batchMode.
java.sql.SQLException
int bindUpdateStatement(EntityImpl entityContext, java.sql.PreparedStatement stmt, AttributeDefImpl[] cols, AttributeDefImpl[] retrCols, AttributeDefImpl[] retrKeyCols, java.util.HashMap retrList, boolean batchMode) throws java.sql.SQLException
Note: this method is subject to change.
entityContext
- the entity object.stmt
- the statement handle executing the UPDATE statement.cols
- the columns involved in the UPDATE statement.retrCols
- the columns whose values need to be fetched after a
successful insert.retrKeyCols
- the columns that act as a key to fetch the newly
inserted values.retrList
- a map containing the references to store the fetched
values.batchMode
- flag to indicate binding for batchMode.
java.sql.SQLException
int bindDeleteStatement(EntityImpl entityContext, java.sql.PreparedStatement stmt) throws java.sql.SQLException
Note: this method is subject to change.
entityContext
- the entity object.stmt
- the statement handle executing the DELETE statement.
java.sql.SQLException
int bindWhereClause(EntityImpl entityContext, java.sql.PreparedStatement stmt, java.lang.Object rowid, int bindIndex) throws java.sql.SQLException
The presence or absence of the ROWID value determines whether the ROWID will be used for Row access.
Note: this method is subject to change.
entityContext
- the Entity row.stmt
- the statement to bind the columns to.rowid
- the ROWID for the row if known.bindIndex
- the baseline idx for performing the bind operations.
java.sql.SQLException
int bindWhereClause(EntityImpl entityContext, java.sql.PreparedStatement stmt, AttributeDefImpl[] retrKeyCols, java.lang.Object rowid, int bindIndex) throws java.sql.SQLException
The presence or absence of the ROWID value determines whether the ROWID will be used for Row access.
Note: this method is subject to change.
entityContext
- the Entity row.stmt
- the statement to bind the columns to.retrKeyCols
- the Primary Key Cols for the Entity row.rowid
- the ROWID for the row if known.bindIndex
- the baseline idx for performing the bind operations.
java.sql.SQLException
void doEntitySelect(EntityImpl e, boolean lock)
Note: this method is subject to change. Note: this method is subject to change.
e
- the Entity Object.lock
- if true, a "SELECT for UPDATE" statement is used.void doEntitySelectForAltKey(EntityImpl e, int keyIndex, boolean lock)
void doStatementSetRowPrefetch(java.sql.Statement ps, int prefetchSize) throws java.sql.SQLException
ps
- the Statement object.prefetchSize
- the fetch size.
java.sql.SQLException
void doStatementSetBindingStyle(java.sql.Statement ps, int bindingStyle)
ps
- the Statement object.bindingStyle
- valid values are BINDING_STYLE_JDBC, BINDING_STYLE_ORACLE,
BINDING_STYLE_ORACLE_NAME.void doStatementSetBindingStyleDefault(java.sql.Statement ps)
Note: this method is subject to change.
ps
- the Statement object.void doPreparedStatementDefineColumnType(java.sql.PreparedStatement ps, int colnum, int sqltype) throws java.sql.SQLException
Note: this method is subject to change.
ps
- the PreparedStatement object.colnum
- the column number.sqltype
- the type of the column.
java.sql.SQLException
void doPreparedStatementDefines(java.sql.PreparedStatement ps, AttributeDefImpl[] attrs)
Note: this method is subject to change.
ps
- the PreparedStatement object.attrs
- the attribute definitions.void populateJboTypeMapEntries()
Note: this method is subject to change.
void populateCompOpers()
boolean isNumericType(int type)
type
- the type that needs to be checked.boolean isCharType(int type)
type
- the type that needs to be checked.boolean isNCharType(java.sql.Statement stmt, int index)
stmt
- A select statement that has been executedindex
- The position of the column to be tested for international character typejava.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) throws DataCreationException
Note: this method is subject to change.
theTypeFactory
- a custom factory to be used for constructing new instances.theElemFactory
- currently unused.theJavaType
- the Java datatype of the Object to be created.attrLoad
- specifies if the load type is
ATTR_LOAD_EACH
,
ATTR_LOAD_BULK
or
ATTR_LOAD_SKIP
rs
- the resultset.index
- the index of the object to be loaded.trans
- the reference to the transaction object used to fetch the resultset.
DataCreationException
java.lang.Object[] doLoadBulkFromResultSet(AttributeDefImpl[] attrs, int attrIndex, java.sql.ResultSet rs, int rsIndex, DBTransactionImpl trans) throws DataCreationException
Note: this method is subject to change.
attrs
- the list of attributes to be loaded.attrIndex
- a particular attribute from the list - Currently unused.rs
- the ResultSet containing the objects.rsIndex
- the index of the object in the result set to be loaded.trans
- the reference to the transaction object used to fetch the resultset.
DataCreationException
java.lang.Object doLoadFromStatement(java.lang.Object theTypeFactory, java.lang.Object theElemFactory, java.lang.Class theJavaType, java.sql.PreparedStatement ps, int index, Transaction trans) throws DataCreationException
Note: this method is subject to change.
theTypeFactory
- a custom factory to be used for constructing new instances.theElemFactory
- currently unused.theJavaType
- the Java datatype of the Object to be created.ps
- the statement reference used to retrieve the Object.index
- the index of the object in the output list.trans
- the reference to the transaction object used to fetch the resultset.
DataCreationException
void setSavepoint(java.sql.Connection conn, java.lang.String id) throws java.sql.SQLException
conn
- the Connection used to create a savepoint.id
- the id for a savepoint.
java.sql.SQLException
void rollbackToSavepoint(java.sql.Connection conn, java.lang.String id) throws java.sql.SQLException
conn
- the Connection used to rollback the savepoint.id
- the id for a savepoint
java.sql.SQLException
void releaseSavepoint(java.sql.Connection conn, java.lang.String id) throws java.sql.SQLException
conn
- the Connection used to release the savepoint.id
- the id for a savepoint
java.sql.SQLException
java.lang.Object generateRowID(EntityImpl e)
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.
Note: this method is subject to change.
e
- the entity object reference.
java.lang.Object generatePKBasedRef(EntityImpl entityContext)
Note: this method is subject to change.
entityContext
- the entity object reference.java.lang.Object[] generateRefAndOID(EntityImpl e)
Note: this method is subject to change.
e
- the entity object reference.boolean isStreamType(int sqlTypeId)
Note: this method is subject to change.
sqlTypeId
- the type to check for streaming support.java.util.ArrayList getTables(java.sql.Connection conn, java.lang.String defaultUserName, java.lang.String userName, java.lang.String nameFilter, boolean bTable, boolean bAlias, boolean bView, boolean bSnap, boolean bIncludeNested) throws java.lang.Exception
getTables(Connection, String, String, String, boolean, boolean, boolean, boolean)
with
an additional parameter to fetch nested tables. Nested tables are fetched only
for Oracle database and OLite.
Note: this method is subject to change.
conn
- the connection object.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.nameFilter
- the filter for the name of the table 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 Materialized View objects in the list.bIncludeNested
- flag to include Nested table objects in the list.
java.lang.Exception
java.util.ArrayList getTables(java.sql.Connection conn, java.lang.String defaultUserName, java.lang.String userName, java.lang.String nameFilter, boolean bTable, boolean bAlias, boolean bView, boolean bSnap) throws java.lang.Exception
Note: this method is subject to change.
conn
- the connection object.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.nameFilter
- the filter for the name of the table 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 Materialized View objects in the list.
java.lang.Exception
java.util.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
getTables(Connection, String, String, String, boolean, boolean, boolean, boolean)
with
no filter on the table name.
Note: this method is subject to change.
conn
- the connection object.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 Materialized View objects in the list.
java.lang.Exception
java.util.ArrayList getTables(java.sql.Connection conn, java.lang.String defaultUserName, java.lang.String userName, boolean bTable, boolean bAlias, boolean bView, boolean bSnap, boolean bIncludeNested) throws java.lang.Exception
getTables(Connection, String, String, String, boolean, boolean, boolean, boolean)
with
no filter on the table name and an additional parameter to fetch nested tables. Nested
tables are fetched only for Oracle database and OLite.
Note: this method is subject to change.
conn
- the connection object.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 Materialized View objects in the list.bIncludeNested
- flag to include Nested table objects in the list.
java.lang.Exception
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
getTables(Connection, String, String, boolean, boolean, boolean, boolean)
.
Note: this method is subject to change.
conn
- the connection object.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 Materialized View objects in the list.
java.lang.Exception
java.util.Vector getTableList(java.sql.Connection conn, java.lang.String defaultUserName, java.lang.String userName, boolean bTable, boolean bAlias, boolean bView, boolean bSnap, boolean bIncludeNested) throws java.lang.Exception
getTables(Connection, String, String, boolean, boolean, boolean, boolean, boolean)
.
Note: this method is subject to change.
conn
- the connection object.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 Materialized View objects in the list.bIncludeNested
- flag to include Nested table objects in the list.
java.lang.Exception
java.util.ArrayList getSchemas(java.sql.Connection conn) throws java.lang.Exception
Note: this method is subject to change.
java.lang.Exception
java.util.Vector getSchemaList(java.sql.Connection conn) throws java.lang.Exception
Note: this method is subject to change.
java.lang.Exception
java.util.ArrayList getDBPackageList(java.sql.Connection conn, java.lang.String userName, java.lang.String packageFilter) throws java.lang.Exception
getDBPackageList(Connection conn, String userName)
.
Note: this method is subject to change.
conn
- the connection object.userName
- the user name for which database packages need to be listed.packageFilter
- the filter the database packages need to be listed.
java.lang.Exception
java.util.ArrayList getDBOperationList(java.sql.Connection connection, java.lang.String userName, java.lang.String packageFilter, java.lang.String operationFilter) throws java.lang.Exception
Note: this method is subject to change.
connection
- the connection object.userName
- the user name for which the database functions and procedures need to be listed.packageFilter
- the filter the database packages in which the functions and procedures need to be listed.operationFilter
- the filter the database functions and procedures need to be listed.
java.lang.Exception
java.util.ArrayList getConstraintsList(java.sql.Connection conn, java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
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
Note: this method is subject to change.
conn
- the connection object.catalog
- the database catalog.schema
- the database schema.table
- the name of the table.
java.sql.SQLException
java.util.Vector getConstraints(java.sql.Connection conn, java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
Note: this method is subject to change.
conn
- the connection object.catalog
- the database catalog.schema
- the database schema.table
- the name of the table.
java.sql.SQLException
java.lang.String getBaseTable(java.sql.Connection conn, java.lang.String schema, java.lang.String name) throws java.sql.SQLException
Note: this method is subject to change.
conn
- the connection object.schema
- the database schema.name
- the name of the potential synonym.
java.sql.SQLException
java.lang.String checkTableNameForQuotes(java.lang.String tableName)
Note: this method is subject to change.
tableName
- the name of the table.
void executeBatch(java.sql.PreparedStatement stmt) throws java.sql.SQLException
Note: this method is subject to change.
stmt
- a PreparedStatement object.
java.sql.SQLException
javax.sql.DataSource lookupDataSource(java.lang.String nsUrl, java.lang.String nsUser, java.lang.String nsPasswd, java.lang.String dataSourceName) throws JboException
Note: this method is subject to change.
nsUrl
- the provider URL.nsUser
- the username to connect to the provider.nsPasswd
- the password to connect to the provider.dataSourceName
- the name of the datasource.
JboException
boolean isDataSourceJTABased(javax.sql.DataSource ds)
Note: this method is subject to change.
ds
- the DataSource object.
ViewCriteriaAdapter getViewCriteriaAdapter()
Note: this method is subject to change.
java.sql.Timestamp getCurrentDbTime(java.sql.Connection conn)
conn
- the connection object.
java.lang.String getCreateSequenceInsertTriggerSQL(java.lang.String triggerName, java.lang.String tableName, java.util.ArrayList sequenceNames, java.util.ArrayList colNames)
Supported for Oracle database only.
Note: this method is subject to change.
triggerName
- the name of the trigger.tableName
- the name of the table for which the trigger is created.sequenceNames
- the array of names of the sequence.colNames
- the arrya of names of the column to which the value of the sequence
is copied to.
java.lang.String getCreateSequenceSQL(java.lang.String sequenceName, int startVal)
Note: this method is subject to change.
sequenceName
- name of the Sequence.startVal
- the initial value of the Sequence.
java.lang.String getDropSequenceSQL(java.lang.String sequenceName)
Note: this method is subject to change.
sequenceName
- name of the Sequence.
java.lang.String getDropTableSQL(java.lang.String dbObjectName)
Note: this method is subject to change.
dbObjectName
- name of the Table.
boolean isDisplayBindValueUI()
void doRefreshSQL(EntityImpl entityContext, int operation, AttributeDefImpl[] columns, AttributeDefImpl[] keyCols)
Note: this method is subject to change.
entityContext
- the Entity row.operation
- SQL Operationcolumns
- Columns to be selected.keyCols
- Key columns to appear be to used to refresh, which appear in WHERE clause.boolean supportsReturningClause()
java.lang.String getQueryHitCountSQL(RowSet rs)
Note: this method is subject to change.
rs
- the RowSet object.
java.lang.String getCappedQueryHitCountSQL(RowSet rs, long cap)
boolean supportsRowNumQuery()
Note: this method is subject to change.
boolean isConnectionAlive(java.sql.Connection conn)
conn
- the connection object.
void buildWhereClause(EntityImpl entityContext, java.lang.StringBuffer buffer, AttributeDefImpl[] keyCols, java.lang.Object rowid)
Note: this method is subject to change.
entityContext
- the entity object.buffer
- the StringBuffer object to which the WHERE clause is appended.keyCols
- the key attributes.rowid
- a rowid object if present.java.lang.Object convertValueToStorageType(java.lang.Object value)
Note: this method is subject to change.
value
- the object that needs to be converted.
void jdbcClientSideSecurity(java.util.Properties info, java.util.Hashtable env)
Note: this method is subject to change.
info
- the properties object to which the values are copied to.env
- the environment object to lookup the security attributes.boolean compareFetchedValue(EntityImpl entity, AttributeDefImpl ad, java.lang.Object cacheValue, java.lang.Object fetchedValue)
Note: this method is subject to change.
entity
- the entity object.ad
- the attribute definition of the value being compared.cacheValue
- the cached value.fetchedValue
- the new fetched value.
void bindParametersForStmt(int bindingStyle, java.lang.Object[] params, java.sql.PreparedStatement stmt) throws java.sql.SQLException
Note: this method is subject to change.
bindingStyle
- specifies if Oracle, Oracle named parameter or JDBC binding style
is used.params
- the list of parameters.stmt
- the statement to be executed.
java.sql.SQLException
void processException(java.lang.String errorCode, java.lang.Exception sqlEx, java.lang.Object[] params)
SQLStmtException
or JboException
.
Note: this method is subject to change.
errorCode
- the SQL execution errorcode.sqlEx
- the Exception object.params
- the query parameters.boolean invalidDatumFactoryUsage(java.lang.String colType, int id, java.lang.Class clz)
int getMaxTableNameLength(java.sql.Connection conn)
conn
- the Database connection object
boolean isNewLineAllowedInSQL(java.sql.Connection conn)
conn
- the Database connection object
void buildDefaultViewObjectFromClause(java.lang.StringBuffer fromClause, java.util.List eRefs, BaseViewCriteriaManagerImpl vcManager)
ViewDefImpl.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT)
fromClause
- A StringBuffer
object that would be appended with
the generated "from" clause.eRefs
- The EntityReference
objects that should be considered
for generation of the "from" clause.vcManager
- In ANSI generation, view criteria associated with the
EntityAssociationReference are part of the FROM clause, and vcManager
is used to build the where clause fragment.
if NULL, view criteria won't be builtvoid buildDefaultViewObjectFromClause(java.lang.StringBuffer fromClause, java.util.List eRefs)
boolean shouldPutJoinConstraintInFromClause()
java.util.HashMap buildDefaultViewObjectWhereClause(java.lang.StringBuffer whereClause, java.util.List eRefs, java.util.List forcedERefs, EntityReference[][] newEntRefsArr, boolean isInlineViewForFroms)
ViewDefImpl.setWhereClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT)
whereClause
- A StringBuffer
object that would be appended with
the generated "where" clause.eRefs
- The EntityReference
objects that should be considered
for generation of the "where" clause.java.lang.String buildEffDtDateDayAddStatement()
String
that contains the necessary SQL.void bindEffDtDateDayAddStatement(java.sql.PreparedStatement stmt, java.lang.Object date, int days) throws java.sql.SQLException
stmt
- The PreparedStatment
object that needs to be bound
with the valuesdate
- The specified datedays
- The number of days the resulting date needs to differ from the
specified date. It could be a positive or a negative number
java.sql.SQLException
java.lang.String getClauseForDateLiteral(java.util.Date date)
date
- The date object that will be formatted and passed as a String
void setSessionTimeZone(java.sql.Connection conn, java.lang.String regionName)
conn
- Connection objectregionName
- timezone region, for example: America/New_YorkADFDatabaseChangeListener registerDatabaseChangeListener(QueryCollection listener, java.sql.Connection conn, java.sql.Statement stmt)
listener
- The Query Collection that holds the qualifying rowsconn
- Connection objectstmt
- The SQL Statement that needs to be monitored for the
database to trigger notifications.
java.lang.String buildRangePagingQuery(ViewObjectImpl vo, java.lang.String qry, int noUserParams)
void bindRangePagingParams(java.sql.PreparedStatement stmt, ViewObjectImpl vo, int nextParamIndex, int rangeStart, int rangeSize)
boolean containsTableAlias(java.lang.String clause, java.lang.String alias)
java.lang.String processClauseForSubQuery(java.lang.String clause, EntityReference[] entRefs, java.lang.String suffix, boolean isSQLExpr, boolean[] isModified)
java.lang.String processClauseReplaceTableAliases(java.lang.String clause, RowReference[] origEntRefs, RowReference[] newEntRefs, boolean isSQLExpr, boolean[] isModified)
java.util.ArrayList<ViewCriteria> getANSIJoinVCs(java.util.List eRefs)
java.lang.String getStringConcatOper(boolean bIncludeSpaces)
bIncludeSpaces
- if the database platform allows spaces before and
after the operator the returned string may include the spaces if the passed
flag is true
.
java.lang.String getFormattedLHSCompareFragment(ViewObject vo, ViewCriteria vc, AttributeDef attrDef, int sqlType, java.lang.String lhs, java.lang.Object rhs)
vo
- the view object instance, could be null if unavailable in the contextvc
- the view criteria instance, could be null if unavailable in the contextattrDef
- the definition of the attribute.sqlType
- the type of the attribute value.rhs
- the value of the attribute.
java.lang.String getFormattedRHSCompareFragment(ViewObject vo, ViewCriteria vc, AttributeDef attrDef, int sqlType, java.lang.String rhs)
vo
- the view object instance, could be null if unavailable in the contextvc
- the view criteria instance, could be null if unavailable in the contextattrDef
- the definition of the attribute.sqlType
- the type of the attribute value.rhs
- the value of the attribute.
void handleSQLException(JboSQLException jboSqlEx)
JboSQLException
.
At minimum, BaseSQLBuilderImpl
checks if the the nested
SQLException
is recoverable and marks as such if true,
which may be used for special handling in database failover scenario.
jboSqlEx
- the JboSQLException
to evaluate.boolean isSQLRecoverableException(java.lang.Exception ex)
ex
- the exception to analyze.
java.lang.String getWildCardEscapeVal(java.lang.String val, boolean isBindVarVal, boolean forQuery)
val
- the value to be processedisBindVarVal
- true indicates that the value is a bind variable reference and false indicates it's a literal value.forQuery
- true if SQL is being built for DB query, false for in-memory.
java.lang.String getEscapeClause(boolean forQuery)
forQuery
- true if SQL is being built for DB query, false for in-memory.
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.6.0) E10653-07 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |