public static class ERXSQLHelper.OracleSQLHelper extends ERXSQLHelper
ERXSQLHelper.ColumnIndex, ERXSQLHelper.CustomTypes, ERXSQLHelper.DB2SQLHelper, ERXSQLHelper.DerbySQLHelper, ERXSQLHelper.EROracleSQLHelper, ERXSQLHelper.FirebirdSQLHelper, ERXSQLHelper.FrontBaseSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.MicrosoftSQLHelper, ERXSQLHelper.MySQLSQLHelper, ERXSQLHelper.NoSQLHelper, ERXSQLHelper.OpenBaseSQLHelper, ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.PostgresqlSQLHelper
Constructor and Description |
---|
OracleSQLHelper() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canReliablyPerformDistinctWithSortOrderings()
Returns whether or not this database can always perform the a distinct operation
when sort orderings are applied.
|
protected char |
commandSeparatorChar()
This is totally cheating ...
|
protected String |
commandSeparatorString() |
String |
createIndexSQLForEntities(NSArray<com.webobjects.eoaccess.EOEntity> entities,
NSArray<String> externalTypesToIgnore) |
String |
createSchemaSQLForEntitiesInModelWithNameAndOptions(NSArray<com.webobjects.eoaccess.EOEntity> entities,
String modelName,
NSDictionary optionsCreate)
oracle 9 has a maximum length of 30 characters for table names,
column names and constraint names Foreign key constraint names are
defined like this from the plugin:
|
String |
externalTypeForJDBCType(com.webobjects.jdbcadaptor.JDBCAdaptor adaptor,
int jdbcType)
JDBCAdaptor.externalTypeForJDBCType just returns the first type it finds
instead of trying to find a best match.
|
String |
limitExpressionForSQL(com.webobjects.eoaccess.EOSQLExpression expression,
com.webobjects.eocontrol.EOFetchSpecification fetchSpecification,
String sql,
long start,
long end) |
String |
migrationTableName()
Returns the name of the table to use for database migrations.
|
boolean |
reassignExternalTypeForValueTypeOverride(EOAttribute attribute) |
String |
sqlForCreateIndex(String indexName,
String tableName,
ERXSQLHelper.ColumnIndex... columnIndexes)
Returns the SQL expression for creating an index on the given set
of columns
|
String |
sqlForCreateUniqueIndex(String indexName,
String tableName,
ERXSQLHelper.ColumnIndex... columnIndexes)
Returns the SQL expression for creating a unique index on the given set
of columns
|
protected String |
sqlForGetNextValFromSequencedNamed(String sequenceName)
Returns the SQL required to select the next value from the given sequence.
|
String |
sqlForRegularExpressionQuery(String key,
String value)
Returns the SQL expression for a regular expression query.
|
protected String |
sqlForSubquery(String subquery,
String alias)
Returns the syntax for using the given query as an aliased subquery in a from-clause.
|
int |
varcharLargeColumnWidth()
Returns the width that should be used for a varcharLarge column in migrations.
|
int |
varcharLargeJDBCType()
For Oracle, it seems the right thing to do for varcharLarge is to use a CLOB column.
|
_groupByOrHavingIndex, _orderByIndex, addGroupByClauseToExpression, addGroupByClauseToExpression, addHavingCountClauseToExpression, appendItemToListString, attributesToFetchForEntity, columnIndexesFromColumnNames, columnNamesFromColumnIndexes, commentPattern, createDependentSchemaSQLForEntities, createIndexSQLForEntities, createSchemaSQLForEntitiesInDatabaseContext, createSchemaSQLForEntitiesInModel, createSchemaSQLForEntitiesInModelAndOptions, createSchemaSQLForEntitiesInModelWithName, createSchemaSQLForEntitiesWithOptions, createSchemaSQLForEntitiesWithOptions, customQueryExpressionHintAsString, defaultOptionDictionary, formatValueForAttribute, getNextValFromSequenceNamed, handleDatabaseException, jdbcTypeForCustomType, maximumElementPerInClause, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, prepareConnectionForSchemaChange, quoteColumnName, readFormatForAggregateFunction, readFormatForAggregateFunction, removeSelectFromExpression, restoreConnectionSettingsAfterSchemaChange, rowCountForFetchSpecification, shouldExecute, shouldPerformDistinctInMemory, splitSQLStatements, splitSQLStatementsFromFile, splitSQLStatementsFromInputStream, sqlExpressionForFetchSpecification, sqlExpressionForFetchSpecification, sqlForCountDistinct, sqlForCreateIndex, sqlForCreateUniqueIndex, sqlForFullTextQuery, sqlWhereClauseStringForKey
protected String sqlForSubquery(String subquery, String alias)
ERXSQLHelper
sqlForSubquery
in class ERXSQLHelper
subquery
- the subquery to wrapalias
- the alias to useprotected String sqlForGetNextValFromSequencedNamed(String sequenceName)
ERXSQLHelper
sqlForGetNextValFromSequencedNamed
in class ERXSQLHelper
sequenceName
- the name of the sequencepublic String createSchemaSQLForEntitiesInModelWithNameAndOptions(NSArray<com.webobjects.eoaccess.EOEntity> entities, String modelName, NSDictionary optionsCreate)
TABLENAME_FOEREIGNKEYNAME_FK
The whole statement looks like this:
ALTER TABLE [TABLENAME] ADD CONSTRAINT [CONSTRAINTNAME] FOREIGN KEY
([FK]) REFERENCES [DESTINATION_TABLE] ([PK]) DEFERRABLE INITIALLY
DEFERRED
THIS means that the tablename and the columnname together cannot be
longer than 26 characters.
This method checks each foreign key constraint name and if it is longer than 30 characters its replaced with a unique name.
createSchemaSQLForEntitiesInModelWithNameAndOptions
in class ERXSQLHelper
entities
- a NSArray containing the entities for which create table
statements should be generated or null
if all entities
in the model should be used.modelName
- the name of the EOModelString
containing SQL statements to create
tablesERXSQLHelper.createSchemaSQLForEntitiesInModelWithNameAndOptions(NSArray, String, NSDictionary)
public String limitExpressionForSQL(com.webobjects.eoaccess.EOSQLExpression expression, com.webobjects.eocontrol.EOFetchSpecification fetchSpecification, String sql, long start, long end)
limitExpressionForSQL
in class ERXSQLHelper
protected char commandSeparatorChar()
ERXSQLHelper
commandSeparatorChar
in class ERXSQLHelper
protected String commandSeparatorString()
commandSeparatorString
in class ERXSQLHelper
public String createIndexSQLForEntities(NSArray<com.webobjects.eoaccess.EOEntity> entities, NSArray<String> externalTypesToIgnore)
createIndexSQLForEntities
in class ERXSQLHelper
public String sqlForCreateUniqueIndex(String indexName, String tableName, ERXSQLHelper.ColumnIndex... columnIndexes)
ERXSQLHelper
sqlForCreateUniqueIndex
in class ERXSQLHelper
indexName
- the name of the index to createtableName
- the name of the containing tablecolumnIndexes
- the list of columns to index onpublic String sqlForCreateIndex(String indexName, String tableName, ERXSQLHelper.ColumnIndex... columnIndexes)
ERXSQLHelper
sqlForCreateIndex
in class ERXSQLHelper
indexName
- the name of the index to createtableName
- the name of the containing tablecolumnIndexes
- the list of columns to index onpublic String sqlForRegularExpressionQuery(String key, String value)
ERXSQLHelper
sqlForRegularExpressionQuery
in class ERXSQLHelper
public String migrationTableName()
ERXSQLHelper
migrationTableName
in class ERXSQLHelper
public String externalTypeForJDBCType(com.webobjects.jdbcadaptor.JDBCAdaptor adaptor, int jdbcType)
ERXSQLHelper
externalTypeForJDBCType
in class ERXSQLHelper
adaptor
- the adaptor to retrieve an external type forjdbcType
- the JDBC type numberpublic boolean reassignExternalTypeForValueTypeOverride(EOAttribute attribute)
reassignExternalTypeForValueTypeOverride
in class ERXSQLHelper
protected boolean canReliablyPerformDistinctWithSortOrderings()
ERXSQLHelper
canReliablyPerformDistinctWithSortOrderings
in class ERXSQLHelper
public int varcharLargeJDBCType()
varcharLargeJDBCType
in class ERXSQLHelper
public int varcharLargeColumnWidth()
ERXSQLHelper
varcharLargeColumnWidth
in class ERXSQLHelper
Copyright © 2002 – 2020 Project Wonder.