|
Business Components | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--oracle.jbo.server.BaseSQLBuilderImpl
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.
| 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 |
BaseSQLBuilderImpl()
|
| Method Summary |
| Type | Method |
|---|---|
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 |
int |
bindWhereClause(EntityImpl entityContext,
java.sql.PreparedStatement stmt,
java.lang.Object rowid,
int bindIndex)
Bind the Primary key values for the designated Statement. |
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 |
protected void |
buildSelectString(java.lang.StringBuffer buffer,
java.lang.String sourceName,
AttributeDefImpl[] attrs,
boolean withIntoClause)
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. |
protected boolean |
capabilityCanReuseLockStatements()
|
protected java.lang.String[] |
convertFlags(boolean bTable,
boolean bAlias,
boolean bView,
boolean bSnap)
|
protected java.lang.Object |
convertValueToWhereFragment(AttributeDef curDef,
java.lang.String trimmedValue)
|
void |
doEntityDML(EntityImpl entityContext,
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 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 ps,
AttributeDefImpl[] attrs)
Performs the equivalent of clearDefines() on a prepared statement. |
void |
doRefreshSQL(EntityImpl entityContext,
int operation,
AttributeDefImpl[] columns,
AttributeDefImpl[] keyCols)
|
void |
doRegisterDefaultDriver()
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)
|
void |
doStatementSetRowPrefetch(java.sql.Statement ps,
int prefetchSize)
Performs the equivalent of setRowPrefetch() on a statement. |
protected static void |
dumpConstraint(java.lang.Object[] constraintEntry)
debug method to be called by all implementors of getConstraints - provides formatted output of the complex constraint struct |
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.Object |
generateRowID(EntityImpl entityContext)
Generates a ROWID 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 |
protected java.lang.String |
getColumnNameWithFormatForQuery(java.lang.String lhspart,
AttributeDef attrDef,
int sqltype)
Deprecated. since 9.0.3 |
java.util.Vector |
getConstraints(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 |
com.sun.java.util.collections.ArrayList |
getConstraintsList(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String user_or_schema,
java.lang.String full_tablename)
return vector of with constraint details for this table where each detail is in a String array with this structure: 0 String owner |
abstract java.lang.String |
getCreateSequenceInsertTriggerSQL(java.lang.String triggerName,
java.lang.String tableName,
java.lang.String sequenceName,
java.lang.String colName)
|
abstract java.lang.String |
getCreateSequenceSQL(java.lang.String sequenceName,
int startVal)
|
java.sql.Timestamp |
getCurrentDbTime(java.sql.Connection conn)
|
abstract java.lang.String |
getDbTimeQuery()
|
abstract 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) |
abstract java.lang.String |
getDropSequenceSQL(java.lang.String sequenceName)
|
abstract 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)
|
protected java.lang.String |
getFormattedRHSCompareFragment(AttributeDef attrDef,
int sqlType,
java.lang.String rhs)
|
protected abstract java.lang.String |
getJDBCDriverClassName()
concrete implementations of SQLBuilder must elect a default driver name |
abstract java.lang.String |
getPersistManagerClassName()
Returns the name of default PersistManager class name. |
java.lang.String |
getQueryHitCountSQL(RowSet rs)
|
protected java.lang.Object |
getROWID(EntityImpl entityContext)
Get the ROWID attribute. |
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) |
com.sun.java.util.collections.ArrayList |
getSchemas(java.sql.Connection conn)
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. |
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 |
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 |
abstract java.lang.String |
getTypeMapName()
Returns a String identifying the preferred type map to use. |
abstract java.lang.String |
getVersion()
Gets a string describing the version of this implentation of this interface. |
ViewCriteriaAdapter |
getViewCriteriaAdapter()
|
java.lang.String |
getViewCriteriaClause(ViewObject vo,
ViewCriteria criteria)
|
protected java.lang.String |
getWarningText(java.lang.String message)
for use withinn DebugDiagnostic messages: returns a preamble with the name of the specific implementation in force |
boolean |
isCharType(int type)
Tests if a type is character |
boolean |
isDataSourceJTABased(javax.sql.DataSource ds)
|
abstract boolean |
isDisplayBindValueUI()
|
boolean |
isNumericType(int type)
Tests if a type is numeric. |
boolean |
isStreamType(int sqlTypeId)
Provides streaming support. |
javax.sql.DataSource |
lookupDataSource(java.lang.String nsUrl,
java.lang.String nsUser,
java.lang.String nsPasswd,
java.lang.String dataSourceName)
|
void |
populateJboTypeMapEntries()
Populates the system typemap table with entries appropriate for the JDBC implementation. |
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 |
protected boolean |
shouldSkipDML(EntityImpl entityContext,
int operation,
TransactionEvent e)
|
boolean |
supportsReturningClause()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BaseSQLBuilderImpl()
| Method Detail |
public abstract java.lang.String getVersion()
SQLBuildergetVersion in interface SQLBuilderpublic abstract java.lang.String getDbType()
SQLBuildergetDbType in interface SQLBuilderpublic abstract java.lang.String getTypeMapName()
SQLBuildergetTypeMapName in interface SQLBuilderpublic abstract java.lang.String getPersistManagerClassName()
SQLBuildergetPersistManagerClassName in interface SQLBuilderpublic abstract java.lang.String getDbTimeQuery()
public abstract java.lang.String getDropTableSQL(java.lang.String dbObjectName)
getDropTableSQL in interface SQLBuilder
public abstract java.lang.String getCreateSequenceInsertTriggerSQL(java.lang.String triggerName,
java.lang.String tableName,
java.lang.String sequenceName,
java.lang.String colName)
getCreateSequenceInsertTriggerSQL in interface SQLBuilder
public abstract java.lang.String getCreateSequenceSQL(java.lang.String sequenceName,
int startVal)
getCreateSequenceSQL in interface SQLBuilderpublic abstract java.lang.String getDropSequenceSQL(java.lang.String sequenceName)
getDropSequenceSQL in interface SQLBuilderpublic abstract boolean isDisplayBindValueUI()
isDisplayBindValueUI in interface SQLBuilderpublic int getDefaultBindingStyle()
getDefaultBindingStyle in interface SQLBuilder
public void doRegisterDefaultDriver()
throws java.sql.SQLException
SQLBuilderdoRegisterDefaultDriver in interface SQLBuilderoracle.jbo.server.SQLBuilderjava.sql.SQLException -
public void executeBatch(java.sql.PreparedStatement stmt)
throws java.sql.SQLException
executeBatch in interface SQLBuilder
protected boolean shouldSkipDML(EntityImpl entityContext,
int operation,
TransactionEvent e)
public void doEntityDML(EntityImpl entityContext,
int operation,
TransactionEvent e)
SQLBuilderNote: this method is subject to change.
doEntityDML in interface SQLBuilderoracle.jbo.server.SQLBuilderenrt - the Entity Object.operation - one of DML_INSERT, DML_UPDATE, or DML_DELETE.e - the transaction.
public void doEntitySelect(EntityImpl entityContext,
boolean lock)
SQLBuilderNote: this method is subject to change.
doEntitySelect in interface SQLBuilderoracle.jbo.server.SQLBuilderenrt - the Entity Object.lock - if true, a "SELECT for UPDATE" statement is used.
public void setSavepoint(java.sql.Connection conn,
java.lang.String id)
throws java.sql.SQLException
SQLBuildersetSavepoint in interface SQLBuilderoracle.jbo.server.SQLBuilderid - = the id for a savepoint
public void rollbackToSavepoint(java.sql.Connection conn,
java.lang.String id)
throws java.sql.SQLException
SQLBuilderrollbackToSavepoint in interface SQLBuilderoracle.jbo.server.SQLBuilderid - = the id for a savepoint
public void releaseSavepoint(java.sql.Connection conn,
java.lang.String id)
throws java.sql.SQLException
SQLBuilderreleaseSavepoint in interface SQLBuilderoracle.jbo.server.SQLBuilderid - = the id for a savepoint
public void doStatementSetRowPrefetch(java.sql.Statement ps,
int prefetchSize)
throws java.sql.SQLException
SQLBuilderdoStatementSetRowPrefetch in interface SQLBuilder
public void doStatementSetBindingStyle(java.sql.Statement ps,
int bindingStyle)
SQLBuilderdoStatementSetBindingStyle in interface SQLBuilderpublic void doStatementSetBindingStyleDefault(java.sql.Statement ps)
doStatementSetBindingStyleDefault in interface SQLBuilder
public void doPreparedStatementDefineColumnType(java.sql.PreparedStatement ps,
int colnum,
int sqltype)
throws java.sql.SQLException
SQLBuilderdoPreparedStatementDefineColumnType in interface SQLBuilder
public void doPreparedStatementDefines(java.sql.PreparedStatement ps,
AttributeDefImpl[] attrs)
SQLBuilderdoPreparedStatementDefines in interface SQLBuilderpublic void populateJboTypeMapEntries()
SQLBuilderpopulateJboTypeMapEntries in interface SQLBuilderpublic boolean isNumericType(int type)
SQLBuilderisNumericType in interface SQLBuilderpublic boolean isCharType(int type)
SQLBuilderisCharType in interface SQLBuilder
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)
SQLBuilderNote: this method is subject to change.
doLoadFromResultSet
in interface SQLBuilderoracle.jbo.server.SQLBuildertheTypeFactory - a custom factory to be used for constructing new instances.index - the index of the object to be loaded.
public java.lang.Object[] doLoadBulkFromResultSet(AttributeDefImpl[] attrDefs,
int attrIndex,
java.sql.ResultSet rs,
int index,
DBTransactionImpl trans)
SQLBuilderNote: this method is subject to change.
doLoadBulkFromResultSet in interface
SQLBuilderoracle.jbo.server.SQLBuilderindex - the index of the object to be loaded.
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)
SQLBuilderNote: this method is subject to change.
doLoadFromStatement in interface
SQLBuilderoracle.jbo.server.SQLBuildertheTypeFactory - a custom factory to be used for constructing new instances.index - the index of the object to be loaded.public java.lang.Object generatePKBasedRef(EntityImpl entityContext)
generatePKBasedRef in interface SQLBuilderpublic java.lang.Object[] generateRefAndOID(EntityImpl entityContext)
SQLBuildergenerateRefAndOID in interface SQLBuilderpublic boolean isStreamType(int sqlTypeId)
SQLBuilderisStreamType in interface SQLBuilderpublic java.lang.Object generateRowID(EntityImpl entityContext)
SQLBuildergenerateRowID in interface SQLBuilder
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
SQLBuildergetTableList in interface SQLBuilder
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
SQLBuildergetTables in interface SQLBuilder
protected java.lang.String[] convertFlags(boolean bTable,
boolean bAlias,
boolean bView,
boolean bSnap)
public java.util.Vector getSchemaList(java.sql.Connection conn)
throws java.lang.Exception
getSchemaList in interface SQLBuilder
public com.sun.java.util.collections.ArrayList getSchemas(java.sql.Connection conn)
throws java.lang.Exception
SQLBuildergetSchemas in interface SQLBuilderprotected java.lang.String getWarningText(java.lang.String message)
protected abstract java.lang.String getJDBCDriverClassName()
public java.lang.StringBuffer buildUpdateStatement(EntityImpl entityContext,
AttributeDefImpl[] cols,
AttributeDefImpl[] retrCols,
AttributeDefImpl[] retrKeyCols,
boolean batchMode)
buildUpdateStatement
in interface SQLBuildersinkName - cols - keyCols - retrCols - retrKeyCols -
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
bindInsertStatement in interface SQLBuilderstmt - cols - keyCols - retrCols - retrKeyCols - retrList - bindIndex - java.sql.SQLException -
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
bindUpdateStatement in interface SQLBuilderstmt - cols - keyCols - retrCols - retrKeyCols - retrList - bindIndex - java.sql.SQLException -
public int bindWhereClause(EntityImpl entityContext,
java.sql.PreparedStatement stmt,
java.lang.Object rowid,
int bindIndex)
throws java.sql.SQLException
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.
bindWhereClause in interface SQLBuilderstmt - the statement to bind the columns to.keyCols - the Primary key columns.rowid - the ROWID for the ROW if known.bindIndex - the baseline idx for performing the bind
operations.protected java.lang.Object getROWID(EntityImpl entityContext)
public void buildWhereClause(EntityImpl entityContext,
java.lang.StringBuffer buffer,
AttributeDefImpl[] keyCols,
java.lang.Object rowid)
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.
buffer - the area into which the WHERE Clause will be placed.keyCols - the Primary key columns.rowid - the ROWID for the ROW if known.
public java.lang.StringBuffer buildInsertStatement(EntityImpl entityContext,
AttributeDefImpl[] cols,
AttributeDefImpl[] retrCols,
AttributeDefImpl[] retrKeyCols,
boolean batchMode)
buildInsertStatement
in interface SQLBuilder - public java.lang.StringBuffer buildDeleteStatement(EntityImpl entityContext)
buildDeleteStatement in interface SQLBuilder -
protected void buildSelectString(java.lang.StringBuffer buffer,
java.lang.String sourceName,
AttributeDefImpl[] attrs,
boolean withIntoClause)
buffer - the area into which the SELECT statement will be placed.
public java.util.Vector getConstraints(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
getConstraints in interface SQLBuilder
public com.sun.java.util.collections.ArrayList getConstraintsList(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String user_or_schema,
java.lang.String full_tablename)
throws java.sql.SQLException
SQLBuilder1 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 <>
getConstraintsList in interface SQLBuilder
public java.lang.String getBaseTable(java.sql.Connection conn,
java.lang.String schema,
java.lang.String name)
throws java.sql.SQLException
SQLBuildergetBaseTable in interface SQLBuilder
public javax.sql.DataSource lookupDataSource(java.lang.String nsUrl,
java.lang.String nsUser,
java.lang.String nsPasswd,
java.lang.String dataSourceName)
throws JboException
lookupDataSource in interface SQLBuilderpublic boolean isDataSourceJTABased(javax.sql.DataSource ds)
isDataSourceJTABased in interface SQLBuilderpublic boolean supportsReturningClause()
supportsReturningClause in interface SQLBuilderprotected boolean capabilityCanReuseLockStatements()
protected java.lang.String getSqlVariantLockTrailer()
protected static void dumpConstraint(java.lang.Object[] constraintEntry)
public ViewCriteriaAdapter getViewCriteriaAdapter()
getViewCriteriaAdapter in interface SQLBuilder
protected java.lang.Object convertValueToWhereFragment(AttributeDef curDef,
java.lang.String trimmedValue)
public java.lang.String getViewCriteriaClause(ViewObject vo,
ViewCriteria criteria)
getViewCriteriaClause in interface ViewCriteriaAdapter
protected java.lang.String getFormattedRHSCompareFragment(AttributeDef attrDef,
int sqlType,
java.lang.String rhs)
protected java.lang.String getFormattedLHSCompareFragment(AttributeDef attrDef,
int sqlType,
java.lang.String lhs,
java.lang.Object rhs)
protected java.lang.String getColumnNameWithFormatForQuery(java.lang.String lhspart,
AttributeDef attrDef,
int sqltype)
public java.sql.Timestamp getCurrentDbTime(java.sql.Connection conn)
getCurrentDbTime in interface SQLBuilder
public void doRefreshSQL(EntityImpl entityContext,
int operation,
AttributeDefImpl[] columns,
AttributeDefImpl[] keyCols)
doRefreshSQL in interface SQLBuilderpublic java.lang.String getQueryHitCountSQL(RowSet rs)
getQueryHitCountSQL in interface SQLBuilder
|
Business Components | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||