Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-03


oracle.jbo.server
Class BaseSQLBuilderImpl

java.lang.Object
  extended by oracle.jbo.common.CommonCriteriaAdapter
      extended by oracle.jbo.server.CriteriaAdapterImpl
          extended by oracle.jbo.server.BaseSQLBuilderImpl

All Implemented Interfaces:
CriteriaAdapter, SQLBuilder, ViewCriteriaAdapter
Direct Known Subclasses:
OLiteSQLBuilderImpl, OracleSQLBuilderImpl, SQL92SQLBuilderImpl

public abstract class BaseSQLBuilderImpl
extends CriteriaAdapterImpl
implements 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.

Since:
JDeveloper 3.0

Field Summary

 

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

 

Constructor Summary
BaseSQLBuilderImpl()
           

 

Method Summary
static void baseBuildSelectList(java.lang.StringBuffer buffer, AttributeDefImpl[] attrs, java.lang.String sourceName, boolean forViewObject)
          Creates a list of columns to be selected skipping the persistent and derived attributes.
 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.
 int bindOptUpdateWhereClause(EntityImpl entityContext, java.sql.PreparedStatement stmt, int bindIndex)
          This method binds the unfetched attributes or a changed attribute of an entity definition.
 void bindParametersForStmt(int bindingStyle, java.lang.Object[] params, java.sql.PreparedStatement stmt)
          Bind parameter values for a SQL execution.
protected  int bindParamValue(int bindingStyle, java.lang.Object value, DBTransactionImpl trans, java.sql.PreparedStatement stmt, AttributeDefImpl attrDef, int bindIndex, boolean skipNull)
          Binds a parameter value to the Statement's bind index dealing with Null values appropriately.
 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.
protected  int bindWhereAttrValue(EntityImpl entityContext, DBTransactionImpl trans, java.sql.PreparedStatement stmt, AttributeDefImpl attrDef, int bindIndex, boolean skipNull)
          Binds an attribute value to the Statement's WHERE clause parameter index dealing with Null values appropriately.
 int bindWhereClause(EntityImpl entityContext, java.sql.PreparedStatement stmt, AttributeDefImpl[] keyCols, 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)
          This method is used to generate the "from" clause
 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)
 void buildDefaultViewObjectWhereClause(java.lang.StringBuffer whereClause, java.util.List eRefs, EntityReference[][] newEntRefsArr)
          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.
 void buildOptUpdateWhereClause(EntityImpl entityContext, java.lang.StringBuffer buffer, AttributeDefImpl[] cols)
          This method binds the unfetched attributes in the list or the change indicator column of an entity definition.
 java.lang.String buildRangePagingQuery(ViewObjectImpl vo, java.lang.String qry, int noUserParams)
           
 void buildSelectList(java.lang.StringBuffer buffer, AttributeDefImpl[] attrs, java.lang.String sourceName, 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.
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)
          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.
protected  boolean capabilityCanReuseLockStatements()
          Check if the a cached prepared statement to lock a row can be reused for this database flavor.
 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)
           
protected  java.lang.String[] convertFlags(boolean bTable, boolean bAlias, boolean bView, boolean bSnap)
           
 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.
protected  java.lang.Object convertValueToWhereFragment(ViewCriteriaItem curDef, java.lang.String trimmedValue)
          Converts a literal value to be used in the WHERE clause.
protected  java.lang.Object convertValueToWhereFragment(ViewObject vo, ViewCriteria vc, ViewCriteriaItem curDef, java.lang.String trimmedValue)
          Converts a literal value to be used in the WHERE clause.
protected  LongRunningStatementHandle createHandleForCancellableStatements(DBTransactionImpl trans, java.sql.Statement stmt)
          Creates a handle that could be used later to terminate a long running statment.
 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.
 void doEntitySelectForAltKey(EntityImpl entityContext, int keyIndex, boolean lock)
           
 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)
          Defines the column types of the attributes based on the meta-data.
 void doRefreshSQL(EntityImpl entityContext, int operation, AttributeDefImpl[] columns, AttributeDefImpl[] retrKeyCols)
          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.
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)
          Executes the PreparedStatement in batch mode.
 int findTableAliasInSQLExpr(java.lang.String clause, java.lang.String alias, int start)
           
 java.lang.Object generatePKBasedRef(EntityImpl entityContext)
          Generates a PK-Based REF for an Entity Object.
 java.lang.Object[] generateRefAndOID(EntityImpl entityContext)
          Generates an object Ref and OID for an Entity Object.
 java.lang.Object generateRowID(EntityImpl entityContext)
          Get the ROWID attribute.
 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.
static int getBindingStyleValue(java.lang.String bindingStyleStr)
           
 java.lang.String getCappedQueryHitCountSQL(RowSet rs, long cap)
           
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 with constraint details for this table.
 java.util.ArrayList getConstraintsList(java.sql.Connection conn, java.lang.String catalog, java.lang.String user_or_schema, java.lang.String full_tablename)
          Return vector 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.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.
abstract  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 connection, java.lang.String userName, java.lang.String packageFilter)
          Return a list of packages visible in this connection.
abstract  java.lang.String getDbTimeQuery()
          Returns a SQL statement to obtain the current time from the database.
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)
          Returns a SQL statement that drops a specified Sequence.
abstract  java.lang.String getDropTableSQL(java.lang.String dbObjectName)
          Returns a SQL statement that drops a specified table.
 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.
protected  java.lang.String getFormattedRHSCompareFragment(AttributeDef attrDef, int sqlType, java.lang.String rhs)
          Override this method to provide a formatted right-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)
          Override this method to provide a formatted right-hand-comparator fragment of a comparision in a where clause for the given column.
protected abstract  java.lang.String getJDBCDriverClassName(java.lang.String url)
          Concrete implementations of SQLBuilder must elect a default driver name.
protected  boolean getLockTrailerIsAtEnd()
          For some databases like SQLServer that row lock clause is placed before the WHERE clause while for some other databases like Oracle it is at the end of SQL Statement.
 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.
abstract  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.
protected  java.lang.String getQuotationMarkLeft()
          Left half of string used to quote database identifiers.
protected  java.lang.String getQuotationMarkRight()
          Right half of string used to quote database identifiers.
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)
 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)
protected  java.lang.String getSqlVariantLockTrailer()
          This defines the string that will be post-fixed to SQL statements to have the rows locked - if the DB is incapable of this then it should return null.
 java.lang.String getStringConcatOper(boolean bIncludeSpaces)
          Returns a String concatenation operator for query clause generation.
protected  boolean getSupportsAliasInUpdateStatements()
          Assume that aliases are permitted, unless a builder denies it
 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.
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()
          Returns a ViewCriteriaAdapter for the SQLBuilder object.
protected  java.lang.String getWarningText(java.lang.String message)
          For use withinn DebugDiagnostic messages.
 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 isConnectionAlive(java.sql.Connection conn)
          Detects if a connection is alive.
 boolean isDataSourceJTABased(javax.sql.DataSource ds)
          Checks if the DataSource is JTA-enabled.
abstract  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 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.
protected  boolean needsQuotedTableName(java.lang.String tableName)
          Inspects the table name if it needs to be escaped with quotes.
 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.
protected  boolean shouldSkipDML(EntityImpl entityContext, int operation, TransactionEvent e)
          Checks if the entity needs to be posted to the database or not.
 boolean supportsReturningClause()
          Checks if the database supports the Returning clause.
 boolean supportsRowNumQuery()
          Checks if the database supports "rownum" identifier.

 

Methods inherited from class oracle.jbo.server.CriteriaAdapterImpl
formatAttributeValue, getBindValsForSqlGen, getFormattedLHSCompareFragment, getFormattedRHSCompareFragment, getRowSetForSqlGen, getViewCriteriaClause, getWhereFragmentFromVO, isCriteriaItemOuterJoined, isLHSFragmentOptional, setupBindVarExtendedData

 

Methods inherited from class oracle.jbo.common.CommonCriteriaAdapter
cleanUpTemporaryBindVariables, cleanUpTemporaryBindVars, convertCriteriaItemToWhereFragment, convertOpandRHSToWhereFragment, convertValueToWhereFragment, correctOprandLiteral, createTempBindVar, createTemporaryBindVar, getCriteriaClause, getCriteriaClause, getFormattedLHSCompareFragment, getOptionalItemClause, isCharType, isDateType, isNumericType, parseOperatorAndValueFromItemValue, shouldUseTempBindVariableForValue

 

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

 

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

 

Constructor Detail

BaseSQLBuilderImpl

public BaseSQLBuilderImpl()

Method Detail

getVersion

public abstract 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
Returns:
a String containing the version.

getDbType

public abstract 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
Returns:
a String containing the Database type.

getTypeMapName

public abstract 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
Returns:
a String containing the type map name.

getPersistManagerClassName

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

getDbTimeQuery

public abstract java.lang.String getDbTimeQuery()
Returns a SQL statement to obtain the current time from the database.
Returns:
a String containing the SQL statement.

getDropTableSQL

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

Note: this method is subject to change.

Specified by:
getDropTableSQL in interface SQLBuilder
Parameters:
dbObjectName - name of the Table.
Returns:
the SQL statement as a String object.

getCreateSequenceInsertTriggerSQL

public abstract java.lang.String getCreateSequenceInsertTriggerSQL(java.lang.String triggerName,
                                                                   java.lang.String tableName,
                                                                   java.util.ArrayList sequenceNames,
                                                                   java.util.ArrayList colNames)
Description copied from interface: SQLBuilder
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.

Supported for Oracle database only.

Note: this method is subject to change.

Specified by:
getCreateSequenceInsertTriggerSQL in interface SQLBuilder
Parameters:
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.
Returns:
the SQL statement as a String object.

getCreateSequenceSQL

public abstract java.lang.String getCreateSequenceSQL(java.lang.String sequenceName,
                                                      int startVal)
Description copied from interface: SQLBuilder
Returns a SQL statement that creates a Sequence with an initial value specified in the argument.

Note: this method is subject to change.

Specified by:
getCreateSequenceSQL in interface SQLBuilder
Parameters:
sequenceName - name of the Sequence.
startVal - the initial value of the Sequence.
Returns:
the SQL statement as a String object.

getDropSequenceSQL

public abstract java.lang.String getDropSequenceSQL(java.lang.String sequenceName)
Description copied from interface: SQLBuilder
Returns a SQL statement that drops a specified Sequence.

Note: this method is subject to change.

Specified by:
getDropSequenceSQL in interface SQLBuilder
Parameters:
sequenceName - name of the Sequence.
Returns:
the SQL statement as a String object.

isDisplayBindValueUI

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

getNestedTables

public java.util.ArrayList getNestedTables(java.sql.Connection conn)
                                    throws java.sql.SQLException
Description copied from interface: SQLBuilder
Returns a list of nested tables in this connection.

Note: this method is subject to change.

Specified by:
getNestedTables in interface SQLBuilder
Parameters:
conn - the connection.
Returns:
null if the platform doesn't support nested tables.
Throws:
java.sql.SQLException

getDefaultBindingStyle

public int getDefaultBindingStyle()
Unless overridden, the binding style is set to JDBC (Oracle versions change this).
Specified by:
getDefaultBindingStyle in interface SQLBuilder
Returns:
an int value of SQLBuilder.BINDING_STYLE_JDBC.

doRegisterDefaultDriver

public void doRegisterDefaultDriver(java.lang.String url)
                             throws java.sql.SQLException
Description copied from interface: SQLBuilder
Registers the JDBC driver associated with this type of JDBC connection.
Specified by:
doRegisterDefaultDriver in interface SQLBuilder
Parameters:
url - JDBC Connection url.
Throws:
java.sql.SQLException

executeBatch

public void executeBatch(java.sql.PreparedStatement stmt)
                  throws java.sql.SQLException
Description copied from interface: SQLBuilder
Executes the PreparedStatement in batch mode. Implemented for Oracle database only by invoking OraclePreparedStatement.executeBatch. Other database flavors throw an exception.

Note: this method is subject to change.

Specified by:
executeBatch in interface SQLBuilder
Parameters:
stmt - a PreparedStatement object.
Throws:
java.sql.SQLException

shouldSkipDML

protected boolean shouldSkipDML(EntityImpl entityContext,
                                int operation,
                                TransactionEvent e)
Checks if the entity needs to be posted to the database or not.
Parameters:
entityContext - the entity object.
operation - the type of operation. For example INSERT, UPDATE.
e - the transaction event triggered.
Returns:
true if the entity is already posted, false otherwise.

createHandleForCancellableStatements

protected LongRunningStatementHandle createHandleForCancellableStatements(DBTransactionImpl trans,
                                                                          java.sql.Statement stmt)
Creates a handle that could be used later to terminate a long running statment. The long running statements for the entity objects are tracked on a transaction object. When Transaction.cancelDMLStatements() is invoked, the long running statements running to execute DMLs for all the entity objects under this transactions are terminated.
Parameters:
trans - the transaction object.
stmt - the statement handle.
Returns:
a long running statement handle.

doEntityDML

public void doEntityDML(EntityImpl entityContext,
                        int operation,
                        TransactionEvent e)
Description copied from interface: SQLBuilder
Performs the appropriate SQL Data Manipulation Language (DML) operations on the database to reflect an update, delete or insert operation on an Entity Object.

Note: this method is subject to change.

Specified by:
doEntityDML in interface SQLBuilder
Parameters:
entityContext - the Entity Object.
operation - one of DML_INSERT, DML_UPDATE, or DML_DELETE.
e - the transaction.

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. Note: this method is subject to change.

Specified by:
doEntitySelect in interface SQLBuilder
Parameters:
entityContext - the Entity Object.
lock - if true, a "SELECT for UPDATE" statement is used.

doEntitySelectForAltKey

public void doEntitySelectForAltKey(EntityImpl entityContext,
                                    int keyIndex,
                                    boolean lock)
Specified by:
doEntitySelectForAltKey in interface SQLBuilder

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
Parameters:
conn - the Connection used to create a savepoint.
id - the id for a savepoint.
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
Parameters:
conn - the Connection used to rollback the savepoint.
id - the id for a savepoint
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
Parameters:
conn - the Connection used to release the savepoint.
id - the id for a savepoint
Throws:
java.sql.SQLException

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
Parameters:
ps - the Statement object.
prefetchSize - the fetch size.
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
Parameters:
ps - the Statement object.
bindingStyle - valid values are BINDING_STYLE_JDBC, BINDING_STYLE_ORACLE, BINDING_STYLE_ORACLE_NAME.

doStatementSetBindingStyleDefault

public void doStatementSetBindingStyleDefault(java.sql.Statement ps)
Description copied from interface: SQLBuilder
Sets the binding style to the default value of the database type. For Oracle database it is set to BINDING_STYLE_ORACLE and for non-oracle databases it is set to BINDING_STYLE_JDBC.

Note: this method is subject to change.

Specified by:
doStatementSetBindingStyleDefault in interface SQLBuilder
Parameters:
ps - the Statement object.

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.

Note: this method is subject to change.

Specified by:
doPreparedStatementDefineColumnType in interface SQLBuilder
Parameters:
ps - the PreparedStatement object.
colnum - the column number.
sqltype - the type of the column.
Throws:
java.sql.SQLException

doPreparedStatementDefines

public void doPreparedStatementDefines(java.sql.PreparedStatement ps,
                                       AttributeDefImpl[] attrs)
Description copied from interface: SQLBuilder
Defines the column types of the attributes based on the meta-data.

Note: this method is subject to change.

Specified by:
doPreparedStatementDefines in interface SQLBuilder
Parameters:
ps - the PreparedStatement object.
attrs - the attribute definitions.

populateJboTypeMapEntries

public void populateJboTypeMapEntries()
Description copied from interface: SQLBuilder
Populates the system typemap table with entries appropriate for the JDBC implementation.

Note: this method is subject to change.

Specified by:
populateJboTypeMapEntries in interface SQLBuilder

populateCompOpers

public void populateCompOpers()
Specified by:
populateCompOpers in interface SQLBuilder

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
Parameters:
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.
Returns:
a reference to the object loaded.

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
Parameters:
attrDefs - the list of attributes to be loaded.
attrIndex - a particular attribute from the list - Currently unused.
rs - the ResultSet containing the objects.
index - the index of the object in the result set to be loaded.
trans - the reference to the transaction object used to fetch the resultset.
Returns:
a reference to the array of objects loaded.

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
Parameters:
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.
Returns:
a reference to the object loaded.

generatePKBasedRef

public java.lang.Object generatePKBasedRef(EntityImpl entityContext)
Description copied from interface: SQLBuilder
Generates a PK-Based REF for an Entity Object. This is used for an object table.

Note: this method is subject to change.

Specified by:
generatePKBasedRef in interface SQLBuilder
Parameters:
entityContext - the entity object reference.

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.

Note: this method is subject to change.

Specified by:
generateRefAndOID in interface SQLBuilder
Parameters:
entityContext - the entity object reference.

isStreamType

public boolean isStreamType(int sqlTypeId)
Description copied from interface: SQLBuilder
Check if a given type provides streaming support.

Note: this method is subject to change.

Specified by:
isStreamType in interface SQLBuilder
Parameters:
sqlTypeId - the type to check for streaming support.

generateRowID

public java.lang.Object generateRowID(EntityImpl entityContext)
Description copied from interface: SQLBuilder
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.

Note: this method is subject to change.

Specified by:
generateRowID in interface SQLBuilder
Parameters:
entityContext - the entity object reference.
Returns:
an Object containing the ROWID or null if generate ROWID fails.

getTableList

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

Note: this method is subject to change.

Specified by:
getTableList in interface SQLBuilder
Parameters:
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.
Returns:
a Vector containing String objects.
Throws:
java.lang.Exception

getTableList

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

Note: this method is subject to change.

Specified by:
getTableList in interface SQLBuilder
Parameters:
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.
Returns:
a Vector containing String objects.
Throws:
java.lang.Exception

getTables

public 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
Description copied from interface: SQLBuilder
Return a list of tables visible in this connection.

Note: this method is subject to change.

Specified by:
getTables in interface SQLBuilder
Parameters:
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.
Returns:
an ArrayList containing String objects.
Throws:
java.lang.Exception

getTables

public 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
Description copied from interface: SQLBuilder
Return a list of tables visible in this connection. Same as getTables(Connection, String, String, String, boolean, boolean, boolean, boolean) with no filter on the table name.

Note: this method is subject to change.

Specified by:
getTables in interface SQLBuilder
Parameters:
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.
Returns:
an ArrayList containing String objects.
Throws:
java.lang.Exception

getTables

public 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
Description copied from interface: SQLBuilder
Return a list of tables visible in this connection. Same as 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.

Specified by:
getTables in interface SQLBuilder
Parameters:
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.
Returns:
an ArrayList containing String objects.
Throws:
java.lang.Exception

getTables

public 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
Description copied from interface: SQLBuilder
Return a list of tables visible in this connection. Same as 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.

Specified by:
getTables in interface SQLBuilder
Parameters:
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.
Returns:
an ArrayList containing String objects.
Throws:
java.lang.Exception

getDBPackageList

public java.util.ArrayList getDBPackageList(java.sql.Connection connection,
                                            java.lang.String userName,
                                            java.lang.String packageFilter)
                                     throws java.lang.Exception
Description copied from interface: SQLBuilder
Return a list of packages visible in this connection. Invokes getDBPackageList(Connection conn, String userName).

Note: this method is subject to change.

Specified by:
getDBPackageList in interface SQLBuilder
Parameters:
connection - 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.
Returns:
a ArrayList containing String objects.
Throws:
java.lang.Exception

getDBOperationList

public java.util.ArrayList getDBOperationList(java.sql.Connection connection,
                                              java.lang.String userName,
                                              java.lang.String packageFilter,
                                              java.lang.String operationFilter)
                                       throws java.lang.Exception
Description copied from interface: SQLBuilder
Return a list of packages visible in this connection.

Note: this method is subject to change.

Specified by:
getDBOperationList in interface SQLBuilder
Parameters:
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.
Returns:
a ArrayList containing String objects.
Throws:
java.lang.Exception

checkTableNameForQuotes

public java.lang.String checkTableNameForQuotes(java.lang.String tableName)
Description copied from interface: SQLBuilder
Add quotes to any table name that may need it.

Note: this method is subject to change.

Specified by:
checkTableNameForQuotes in interface SQLBuilder
Parameters:
tableName - the name of the table.
Returns:
the quoted table name if needed otherwise returns the table name unaltered.

needsQuotedTableName

protected boolean needsQuotedTableName(java.lang.String tableName)
Inspects the table name if it needs to be escaped with quotes.
Parameters:
tableName - the table name.
Returns:
true if quotes are needed, false otherwise.

getQuotationMarkLeft

protected java.lang.String getQuotationMarkLeft()
Left half of string used to quote database identifiers.
Returns:
a String object.

getQuotationMarkRight

protected java.lang.String getQuotationMarkRight()
Right half of string used to quote database identifiers.
Returns:
a String object.

getLockTrailerIsAtEnd

protected boolean getLockTrailerIsAtEnd()
For some databases like SQLServer that row lock clause is placed before the WHERE clause while for some other databases like Oracle it is at the end of SQL Statement.
Returns:
true if the row lock clause is at the end, false otherwise.

convertFlags

protected java.lang.String[] convertFlags(boolean bTable,
                                          boolean bAlias,
                                          boolean bView,
                                          boolean bSnap)

getSchemaList

public java.util.Vector getSchemaList(java.sql.Connection conn)
                               throws java.lang.Exception
Description copied from interface: SQLBuilder
Return a list of schemas for this database (note that for Oracle this is synonymous with users)

Note: this method is subject to change.

Specified by:
getSchemaList in interface SQLBuilder
Returns:
a Vector containing String objects.
Throws:
java.lang.Exception

getSchemas

public java.util.ArrayList getSchemas(java.sql.Connection conn)
                               throws java.lang.Exception
Description copied from interface: SQLBuilder
Return a list of schemas for this database (note that for Oracle this is synonymous with users)

Note: this method is subject to change.

Specified by:
getSchemas in interface SQLBuilder
Returns:
an ArrayList containing String objects.
Throws:
java.lang.Exception

getWarningText

protected java.lang.String getWarningText(java.lang.String message)
For use withinn DebugDiagnostic messages.
Parameters:
message - the warning message.
Returns:
a preamble with the name of the specific implementation in force.

getJDBCDriverClassName

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

buildUpdateStatement

public java.lang.StringBuffer buildUpdateStatement(EntityImpl entityContext,
                                                   AttributeDefImpl[] cols,
                                                   AttributeDefImpl[] retrCols,
                                                   AttributeDefImpl[] retrKeyCols,
                                                   boolean batchMode)
Description copied from interface: SQLBuilder
Build a UPDATE SQL for the Entity Object skipping non-persistent values. If there are attributes in the Entity Object that need to be fetched after the UPDATE succeeds, a CallableStatement is created to fetch those values.

Note: this method is subject to change.

Specified by:
buildUpdateStatement in interface SQLBuilder
Parameters:
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.
Returns:
a StringBuffer object containing the UPDATE statement.

bindInsertStatement

public int bindInsertStatement(EntityImpl entityContext,
                               java.sql.PreparedStatement stmt,
                               AttributeDefImpl[] cols,
                               AttributeDefImpl[] retrCols,
                               AttributeDefImpl[] retrKeyCols,
                               java.util.HashMap retrList,
                               boolean batchMode)
                        throws java.sql.SQLException
Description copied from interface: SQLBuilder
Binds the entity attribute storage with the parameters in the INSERT statement.

Note: this method is subject to change.

Specified by:
bindInsertStatement in interface SQLBuilder
Parameters:
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.
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,
                               java.util.HashMap retrList,
                               boolean batchMode)
                        throws java.sql.SQLException
Description copied from interface: SQLBuilder
Binds the entity attribute storage with the parameters in the UPDATE statement.

Note: this method is subject to change.

Specified by:
bindUpdateStatement in interface SQLBuilder
Parameters:
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.
Returns:
index of last bind variable set in this statement.
Throws:
java.sql.SQLException

bindDeleteStatement

public int bindDeleteStatement(EntityImpl entityContext,
                               java.sql.PreparedStatement stmt)
                        throws java.sql.SQLException
Description copied from interface: SQLBuilder
Binds the values in the entity attribute storage with the DELETE statement.

Note: this method is subject to change.

Specified by:
bindDeleteStatement in interface SQLBuilder
Parameters:
entityContext - the entity object.
stmt - the statement handle executing the DELETE statement.
Throws:
java.sql.SQLException

bindParamValue

protected int bindParamValue(int bindingStyle,
                             java.lang.Object value,
                             DBTransactionImpl trans,
                             java.sql.PreparedStatement stmt,
                             AttributeDefImpl attrDef,
                             int bindIndex,
                             boolean skipNull)
                      throws java.sql.SQLException
Binds a parameter value to the Statement's bind index dealing with Null values appropriately.
Parameters:
bindingStyle - one of the SQLBuilder binding style constants.
value - the object value to bind.
trans - the transaction object.
stmt - the Statement object carrying out the SQL.
attrDef - the defintion of the attribute to which the value belongs.
bindIndex - the parameter index in the PreparedStatement.
skipNull - indicates if the null values need to be bound or skipped.
Returns:
a new bind index value so that this method can be invoked in a loop.
Throws:
java.sql.SQLException

bindWhereAttrValue

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

bindWhereClause

public int bindWhereClause(EntityImpl entityContext,
                           java.sql.PreparedStatement stmt,
                           java.lang.Object rowid,
                           int bindIndex)
                    throws java.sql.SQLException
Description copied from interface: SQLBuilder
Bind the Primary key values for the designated Statement. This routine will perform the bind operation for each of the Primary Key columns.

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.

Specified by:
bindWhereClause in interface SQLBuilder
Parameters:
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.
Returns:
index of last bind variable set in this statement.
Throws:
java.sql.SQLException

bindWhereClause

public int bindWhereClause(EntityImpl entityContext,
                           java.sql.PreparedStatement stmt,
                           AttributeDefImpl[] keyCols,
                           java.lang.Object rowid,
                           int bindIndex)
                    throws java.sql.SQLException
Description copied from interface: SQLBuilder
Bind the Primary key values for the designated Statement. This routine will perform the bind operation for each of the Primary Key columns.

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.

Specified by:
bindWhereClause in interface SQLBuilder
Parameters:
entityContext - the Entity row.
stmt - the statement to bind the columns to.
keyCols - 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.
Returns:
index of last bind variable set in this statement.
Throws:
java.sql.SQLException

bindOptUpdateWhereClause

public int bindOptUpdateWhereClause(EntityImpl entityContext,
                                    java.sql.PreparedStatement stmt,
                                    int bindIndex)
                             throws java.sql.SQLException
This method binds the unfetched attributes or a changed attribute of an entity definition.
Parameters:
entityContext - the entity definition.
stmt - the Statement object.
bindIndex - the current bind index.
Returns:
index of last bind variable set in this statement.
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.
Parameters:
entityContext - the entity object.
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)
Description copied from interface: SQLBuilder
Creates a WHERE clause containing the Primary Key columns passed to the method.

Note: this method is subject to change.

Specified by:
buildWhereClause in interface SQLBuilder
Parameters:
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.

buildOptUpdateWhereClause

public void buildOptUpdateWhereClause(EntityImpl entityContext,
                                      java.lang.StringBuffer buffer,
                                      AttributeDefImpl[] cols)
This method binds the unfetched attributes in the list or the change indicator column of an entity definition.
Parameters:
entityContext - the entity definition.
buffer - the storage for the WHERE clause.
cols - the attributes to be considered for fetching.

buildInsertStatement

public java.lang.StringBuffer buildInsertStatement(EntityImpl entityContext,
                                                   AttributeDefImpl[] cols,
                                                   AttributeDefImpl[] retrCols,
                                                   AttributeDefImpl[] retrKeyCols,
                                                   boolean batchMode)
Description copied from interface: SQLBuilder
Build a INSERT SQL for the Entity Object skipping non-persistent values. If there are attributes in the Entity Object that need to be fetched after the INSERT succeeds, a CallableStatement is created to fetch those values.

Note: this method is subject to change.

Specified by:
buildInsertStatement in interface SQLBuilder
Parameters:
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.
Returns:
a StringBuffer object containing the INSERT statement.

buildDeleteStatement

public java.lang.StringBuffer buildDeleteStatement(EntityImpl entityContext)
Description copied from interface: SQLBuilder
Build a DELETE SQL for the Entity Object. The row is deleted from the table using the values of the Primary keys defined in the Entity.

Note: this method is subject to change.

Specified by:
buildDeleteStatement in interface SQLBuilder
Parameters:
entityContext - the entity object.
Returns:
a StringBuffer object containing the UPDATE statement.

baseBuildSelectList

public static void baseBuildSelectList(java.lang.StringBuffer buffer,
                                       AttributeDefImpl[] attrs,
                                       java.lang.String sourceName,
                                       boolean forViewObject)
Creates a list of columns to be selected skipping the persistent and derived attributes.
Parameters:
buffer - the storage for the WHERE clause.
attrs - the attributes to be considered for the select list.
sourceName - the name of the table - unused.

buildSelectList

public void buildSelectList(java.lang.StringBuffer buffer,
                            AttributeDefImpl[] attrs,
                            java.lang.String sourceName,
                            boolean forViewObject)
Description copied from interface: SQLBuilder
Build a list of columns that could be used in a SELECT statement.

Note: this method is subject to change.

Specified by:
buildSelectList in interface SQLBuilder
Parameters:
buffer - the StringBuffer object to which the SELECT list is appended.
attrs - the list of attribute definitions to be considered for the SELECT list.
sourceName - the database object name that contains the attributes.

buildSelectString

public void buildSelectString(DBTransactionImpl trans,
                              java.lang.StringBuffer buffer,
                              java.lang.String sourceName,
                              java.lang.String sourceAlias,
                              AttributeDefImpl[] attrs,
                              boolean withIntoClause,
                              int bindingStyle)
Description copied from interface: SQLBuilder
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.

Note: this method is subject to change.

Specified by:
buildSelectString in interface SQLBuilder
Parameters:
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.

buildSelectString

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. 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.
Parameters:
buffer - the area into which the SELECT statement will be placed.
sourceName - the database object from which the Columns are selected.
attrs - the attributes that are selected from the database object.
withIntoClause - a boolean that indicates if an INTO Clause needs to be generated.

getConstraints

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
Description copied from interface: SQLBuilder
Return vector with constraint details for this table.

Note: this method is subject to change.

Specified by:
getConstraints in interface SQLBuilder
Parameters:
conn - the connection object.
catalog - the database catalog.
schema - the database schema.
table - the name of the table.
Returns:
a Vector containing an array of String objects.
Throws:
java.sql.SQLException

getConstraintsList

public java.util.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
Description copied from interface: SQLBuilder
Return vector 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

Note: this method is subject to change.

Specified by:
getConstraintsList in interface SQLBuilder
Parameters:
conn - the connection object.
catalog - the database catalog.
user_or_schema - the database schema.
full_tablename - the name of the table.
Returns:
an ArrayList containing an array of String objects.
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.

Note: this method is subject to change.

Specified by:
getBaseTable in interface SQLBuilder
Parameters:
conn - the connection object.
schema - the database schema.
name - the name of the potential synonym.
Returns:
a String containing the real table name. Note that even if the argument is a table name it may be altered to enforce consistent naming convention. For non-Oracle databases the name is returned unaltered.
Throws:
java.sql.SQLException

lookupDataSource

public javax.sql.DataSource lookupDataSource(java.lang.String nsUrl,
                                             java.lang.String nsUser,
                                             java.lang.String nsPasswd,
                                             java.lang.String dataSourceName)
                                      throws JboException
Description copied from interface: SQLBuilder
Performs a JNDI lookup for the datasource. Supported for Oracle database only.

Note: this method is subject to change.

Specified by:
lookupDataSource in interface SQLBuilder
Parameters:
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.
Returns:
a DataSource definition object if lookup is successful, null otherwise.
Throws:
JboException

isDataSourceJTABased

public boolean isDataSourceJTABased(javax.sql.DataSource ds)
Description copied from interface: SQLBuilder
Checks if the DataSource is JTA-enabled.

Note: this method is subject to change.

Specified by:
isDataSourceJTABased in interface SQLBuilder
Parameters:
ds - the DataSource object.
Returns:
true if the data source is JTA-enabled, false otherwise.

supportsReturningClause

public boolean supportsReturningClause()
Description copied from interface: SQLBuilder
Checks if the database supports the Returning clause.
Specified by:
supportsReturningClause in interface SQLBuilder
Returns:
true for Oracle database and false otherwise.

supportsRowNumQuery

public boolean supportsRowNumQuery()
Description copied from interface: SQLBuilder
Checks if the database supports "rownum" identifier. Used for fetching rows in the specified range.

Note: this method is subject to change.

Specified by:
supportsRowNumQuery in interface SQLBuilder
Returns:
true for Oracle database and false otherwise.

buildRangePagingQuery

public java.lang.String buildRangePagingQuery(ViewObjectImpl vo,
                                              java.lang.String qry,
                                              int noUserParams)
Specified by:
buildRangePagingQuery in interface SQLBuilder

bindRangePagingParams

public void bindRangePagingParams(java.sql.PreparedStatement stmt,
                                  ViewObjectImpl vo,
                                  int nextParamIndex,
                                  int rangeStart,
                                  int rangeSize)
Specified by:
bindRangePagingParams in interface SQLBuilder

capabilityCanReuseLockStatements

protected boolean capabilityCanReuseLockStatements()
Check if the a cached prepared statement to lock a row can be reused for this database flavor.
Returns:
returns a default of true. Specialized SQLBuilders override this method.

getSqlVariantLockTrailer

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

getSupportsAliasInUpdateStatements

protected boolean getSupportsAliasInUpdateStatements()
Assume that aliases are permitted, unless a builder denies it
Returns:
true if aliases are supported, false otherwise
Since:
10.1.2 29Jul04

dumpConstraint

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.

getViewCriteriaAdapter

public ViewCriteriaAdapter getViewCriteriaAdapter()
Description copied from interface: SQLBuilder
Returns a ViewCriteriaAdapter for the SQLBuilder object. ViewCriteriaAdapter is used in creating WHERE clause based on a set of criteria for a ViewObject.

Note: this method is subject to change.

Specified by:
getViewCriteriaAdapter in interface SQLBuilder
Returns:
a ViewCriteriaAdapter instance.

convertValueToWhereFragment

protected java.lang.Object convertValueToWhereFragment(ViewCriteriaItem curDef,
                                                       java.lang.String trimmedValue)
Converts a literal value to be used in the WHERE clause. Applies attribute formatting where needed.
Parameters:
curDef - the attribute definition.
trimmedValue - the literal value.
Returns:
a StringBuffer object containing the SQL fragment.

convertValueToWhereFragment

protected java.lang.Object convertValueToWhereFragment(ViewObject vo,
                                                       ViewCriteria vc,
                                                       ViewCriteriaItem curDef,
                                                       java.lang.String trimmedValue)
Converts a literal value to be used in the WHERE clause. Applies attribute formatting where needed.
Parameters:
vo - the view object definition
vc - the view criteria definition to figure out if attribute value needs to be formatted
curDef - the attribute definition.
trimmedValue - the literal value.
Returns:
a StringBuffer object containing the SQL fragment.

getFormattedRHSCompareFragment

protected java.lang.String getFormattedRHSCompareFragment(AttributeDef attrDef,
                                                          int sqlType,
                                                          java.lang.String rhs)
Override this method to provide a formatted right-hand-comparator fragment of a comparision in a where clause for the given column.
Parameters:
attrDef - the definition of the attribute.
sqlType - the type of the attribute value.
rhs - the value of the attribute.
Returns:
a String containing the SQL fragment.

getFormattedRHSCompareFragment

public java.lang.String getFormattedRHSCompareFragment(ViewObject vo,
                                                       ViewCriteria vc,
                                                       AttributeDef attrDef,
                                                       int sqlType,
                                                       java.lang.String rhs)
Override this method to provide a formatted right-hand-comparator fragment of a comparision in a where clause for the given column.
Specified by:
getFormattedRHSCompareFragment in interface SQLBuilder
Parameters:
vo - the view object definition.
vc - the view criteria definition.
attrDef - the definition of the attribute.
sqlType - the type of the attribute value.
rhs - the value of the attribute.
Returns:
a String containing the SQL fragment.

getFormattedLHSCompareFragment

public java.lang.String getFormattedLHSCompareFragment(ViewObject vo,
                                                       ViewCriteria vc,
                                                       AttributeDef attrDef,
                                                       int sqlType,
                                                       java.lang.String lhs,
                                                       java.lang.Object rhs)
Description copied from interface: SQLBuilder
This method provides a formatted left-hand-comparator fragment of a comparision in a where clause for the given column.
Specified by:
getFormattedLHSCompareFragment in interface SQLBuilder
Parameters:
vo - the view object instance, could be null if unavailable in the context
vc - the view criteria instance, could be null if unavailable in the context
attrDef - the definition of the attribute.
sqlType - the type of the attribute value.
rhs - the value of the attribute.
Returns:
a String containing the SQL fragment.

getColumnNameWithFormatForQuery

protected java.lang.String getColumnNameWithFormatForQuery(java.lang.String lhspart,
                                                           AttributeDef attrDef,
                                                           int sqltype)
Deprecated. since 9.0.3

getCurrentDbTime

public java.sql.Timestamp getCurrentDbTime(java.sql.Connection conn)
Description copied from interface: SQLBuilder
Returns the current time from the Database.
Specified by:
getCurrentDbTime in interface SQLBuilder
Parameters:
conn - the connection object.
Returns:
a Timestamp containing the Database time.

doRefreshSQL

public void doRefreshSQL(EntityImpl entityContext,
                         int operation,
                         AttributeDefImpl[] columns,
                         AttributeDefImpl[] retrKeyCols)
Description copied from interface: SQLBuilder
Refreshes the entity after an update on the database. The refresh depends entirely on, the attributes which were modified. If no UNIQUE/PRIMARY KEY attribute was set in the application, or they are modified in a database trigger then the refresh may not be able to find the required row. In this situation RowNotFoundException will be thrown. If there is good reason behind not setting any of the KEY attributes, then, in a custom SQLBuilder, this method should be overriden.

Note: this method is subject to change.

Specified by:
doRefreshSQL in interface SQLBuilder
Parameters:
entityContext - the Entity row.
operation - SQL Operation
columns - Columns to be selected.
retrKeyCols - Key columns to appear be to used to refresh, which appear in WHERE clause.

getQueryHitCountSQL

public java.lang.String getQueryHitCountSQL(RowSet rs)
Description copied from interface: SQLBuilder
Returns a SQL statement to estimate the number of rows effected by the query using the rowset values.

Note: this method is subject to change.

Specified by:
getQueryHitCountSQL in interface SQLBuilder
Parameters:
rs - the RowSet object.
Returns:
the SQL statement as a String object.

getCappedQueryHitCountSQL

public java.lang.String getCappedQueryHitCountSQL(RowSet rs,
                                                  long cap)
Specified by:
getCappedQueryHitCountSQL in interface SQLBuilder

isConnectionAlive

public boolean isConnectionAlive(java.sql.Connection conn)
Description copied from interface: SQLBuilder
Detects if a connection is alive.
Specified by:
isConnectionAlive in interface SQLBuilder
Parameters:
conn - the connection object.
Returns:
true if the connection is active, false otherwise.

convertValueToStorageType

public java.lang.Object convertValueToStorageType(java.lang.Object value)
Description copied from interface: SQLBuilder
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.

Note: this method is subject to change.

Specified by:
convertValueToStorageType in interface SQLBuilder
Parameters:
value - the object that needs to be converted.
Returns:
the JDBC type.

jdbcClientSideSecurity

public void jdbcClientSideSecurity(java.util.Properties info,
                                   java.util.Hashtable env)
Description copied from interface: SQLBuilder
Populates the properties with known security attributes found in the environment. Used for Oracle JDBC connectivity only. The values are copied into the Properties from the Session's environment.

Note: this method is subject to change.

Specified by:
jdbcClientSideSecurity in interface SQLBuilder
Parameters:
info - the properties object to which the values are copied to.
env - the environment object to lookup the security attributes.

compareFetchedValue

public boolean compareFetchedValue(EntityImpl entity,
                                   AttributeDefImpl ad,
                                   java.lang.Object cacheValue,
                                   java.lang.Object fetchedValue)
Description copied from interface: SQLBuilder
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. Signature modified since 9.0.5.1 to allow for Entity context to be available during compare so that Applications could perform custom comparision logic based on either settings in the Entity or any other context available via the entity.

Note: this method is subject to change.

Specified by:
compareFetchedValue in interface SQLBuilder
Parameters:
entity - the entity object.
ad - the attribute definition of the value being compared.
cacheValue - the cached value.
fetchedValue - the new fetched value.
Returns:
true if the values are same, false otherwise.

bindParametersForStmt

public void bindParametersForStmt(int bindingStyle,
                                  java.lang.Object[] params,
                                  java.sql.PreparedStatement stmt)
                           throws java.sql.SQLException
Description copied from interface: SQLBuilder
Bind parameter values for a SQL execution.

Note: this method is subject to change.

Specified by:
bindParametersForStmt in interface SQLBuilder
Parameters:
bindingStyle - specifies if Oracle, Oracle named parameter or JDBC binding style is used.
params - the list of parameters.
stmt - the statement to be executed.
Throws:
java.sql.SQLException

processException

public void processException(java.lang.String errorCode,
                             java.lang.Exception sqlEx,
                             java.lang.Object[] params)
Description copied from interface: SQLBuilder
Handle SQL exceptions by wrapping into SQLStmtException or JboException.

Note: this method is subject to change.

Specified by:
processException in interface SQLBuilder
Parameters:
errorCode - the SQL execution errorcode.
sqlEx - the Exception object.
params - the query parameters.

invalidDatumFactoryUsage

public boolean invalidDatumFactoryUsage(java.lang.String colType,
                                        int id,
                                        java.lang.Class clz)
Description copied from interface: SQLBuilder
Returns false only for types where raw-bytes may be used to create the desired attribute values while fetching data from jdbc. Most subclasses will return true for this method.
Specified by:
invalidDatumFactoryUsage in interface SQLBuilder

getMaxTableNameLength

public int getMaxTableNameLength(java.sql.Connection conn)
Description copied from interface: SQLBuilder
Return the maximum length of a table name for the Database connection.
Specified by:
getMaxTableNameLength in interface SQLBuilder
Parameters:
conn - the Database connection object
Returns:
a non-zero integer if the table name length can be determined, zero otherwise.

isNewLineAllowedInSQL

public boolean isNewLineAllowedInSQL(java.sql.Connection conn)
Description copied from interface: SQLBuilder
Checks if the JDBC driver supports new line character in SQL statements. Over-ridden by DB2SQLBuilderImpl to return false when using DB2 Universal Driver (Type IV).
Specified by:
isNewLineAllowedInSQL in interface SQLBuilder
Parameters:
conn - the Database connection object
Returns:
true if the driver supports a new line character

getBindingStyleValue

public static int getBindingStyleValue(java.lang.String bindingStyleStr)

buildDefaultViewObjectFromClause

public void buildDefaultViewObjectFromClause(java.lang.StringBuffer fromClause,
                                             java.util.List eRefs)
Description copied from interface: SQLBuilder
This method is used to generate the "from" clause
Specified by:
buildDefaultViewObjectFromClause in interface SQLBuilder

buildDefaultViewObjectFromClause

public void buildDefaultViewObjectFromClause(java.lang.StringBuffer fromClause,
                                             java.util.List eRefs,
                                             BaseViewCriteriaManagerImpl vcManager)
Description copied from interface: SQLBuilder
This method is used to generate the "from" clause if the following conditions are met: