ERXSQLHelper Class Reference

Inherited by ERXSQLHelper.DerbySQLHelper, ERXSQLHelper.FrontBaseSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.MicrosoftSQLHelper, ERXSQLHelper.MySQLSQLHelper, ERXSQLHelper.NoSQLHelper, ERXSQLHelper.OpenBaseSQLHelper, ERXSQLHelper.OracleSQLHelper, and ERXSQLHelper.PostgresqlSQLHelper.

Collaboration diagram for ERXSQLHelper:

Collaboration graph
[legend]

List of all members.

Classes

class  ColumnIndex
interface  CustomTypes
class  DerbySQLHelper
class  EROracleSQLHelper
class  FrontBaseSQLHelper
class  H2SQLHelper
class  MicrosoftSQLHelper
class  MySQLSQLHelper
class  NoSQLHelper
class  OpenBaseSQLHelper
class  OracleSQLHelper
class  PostgresqlSQLHelper

Public Member Functions

int _groupByOrHavingIndex (EOSQLExpression expression)
int _orderByIndex (EOSQLExpression expression)
void addGroupByClauseToExpression (NSArray< EOAttribute > attributes, EOSQLExpression expression)
void addGroupByClauseToExpression (EOEditingContext editingContext, EOFetchSpecification fetchSpec, EOSQLExpression expression)
void addHavingCountClauseToExpression (NSSelector selector, int value, EOSQLExpression expression)
void appendItemToListString (String itemString, StringBuffer listString)
NSArray< EOAttribute > attributesToFetchForEntity (EOFetchSpecification fetchSpec, EOEntity entity)
NSMutableArray< StringcolumnNamesFromColumnIndexes (ColumnIndex...columnIndexes)
String createDependentSchemaSQLForEntities (NSArray< EOEntity > entities, EOAdaptor adaptor)
String createIndexSQLForEntities (NSArray< EOEntity > entities, NSArray< String > externalTypesToIgnore)
String createIndexSQLForEntities (NSArray< EOEntity > entities)
String createSchemaSQLForEntitiesInDatabaseContext (NSArray< EOEntity > entities, EODatabaseContext databaseContext, boolean create, boolean drop)
String createSchemaSQLForEntitiesInModel (NSArray< EOEntity > entities, EOModel model)
String createSchemaSQLForEntitiesInModelAndOptions (NSArray< EOEntity > entities, EOModel model, NSDictionary optionsCreate)
String createSchemaSQLForEntitiesInModelWithName (NSArray< EOEntity > entities, String modelName)
String createSchemaSQLForEntitiesInModelWithNameAndOptions (NSArray< EOEntity > entities, String modelName, NSDictionary optionsCreate)
String createSchemaSQLForEntitiesWithOptions (NSArray< EOEntity > entities, EOAdaptor adaptor, NSDictionary< String, String > optionsDictionary)
String createSchemaSQLForEntitiesWithOptions (NSArray< EOEntity > entities, EODatabaseContext databaseContext, NSDictionary< String, String > optionsCreate)
String customQueryExpressionHintAsString (Object hint)
NSMutableDictionary< String,
String
defaultOptionDictionary (boolean create, boolean drop)
String externalTypeForJDBCType (JDBCAdaptor adaptor, int jdbcType)
Number getNextValFromSequenceNamed (EOEditingContext ec, String modelName, String sequenceName)
boolean handleDatabaseException (EODatabaseContext databaseContext, Throwable throwable)
int jdbcTypeForCustomType (int jdbcType)
String limitExpressionForSQL (EOSQLExpression expression, EOFetchSpecification fetchSpecification, String sql, long start, long end)
String migrationTableName ()
void prepareConnectionForSchemaChange (EOEditingContext ec, EOModel model)
String quoteColumnName (String columnName)
String readFormatForAggregateFunction (String functionName, String columnName, String aggregateName)
boolean reassignExternalTypeForValueTypeOverride (EOAttribute attribute)
void removeSelectFromExpression (EOAttribute attribute, EOSQLExpression sqlExpression)
void restoreConnectionSettingsAfterSchemaChange (EOEditingContext ec, EOModel model)
int rowCountForFetchSpecification (EOEditingContext ec, EOFetchSpecification spec)
boolean shouldExecute (String sql)
boolean shouldPerformDistinctInMemory (EOFetchSpecification fetchSpecification)
NSArray< StringsplitSQLStatements (String sql)
NSArray< StringsplitSQLStatementsFromFile (File f) throws IOException
NSArray< StringsplitSQLStatementsFromInputStream (InputStream is) throws IOException
EOSQLExpression sqlExpressionForFetchSpecification (EOEditingContext ec, EOFetchSpecification spec, long start, long end, NSArray< EOAttribute > attributes)
EOSQLExpression sqlExpressionForFetchSpecification (EOEditingContext ec, EOFetchSpecification spec, long start, long end)
String sqlForCreateIndex (String indexName, String tableName, ColumnIndex...columnIndexes)
String sqlForCreateIndex (String indexName, String tableName, String...columnNames)
String sqlForCreateUniqueIndex (String indexName, String tableName, ColumnIndex...columnIndexes)
String sqlForCreateUniqueIndex (String indexName, String tableName, String...columnNames)
String sqlForFullTextQuery (ERXFullTextQualifier qualifier, EOSQLExpression expression)
String sqlForRegularExpressionQuery (String key, String value)
String sqlWhereClauseStringForKey (EOSQLExpression e, String key, NSArray valueArray)
int varcharLargeColumnWidth ()
int varcharLargeJDBCType ()

Static Public Member Functions

static ERXSQLHelper newSQLHelper (String databaseProductName)
static ERXSQLHelper newSQLHelper (EOModel model)
static ERXSQLHelper newSQLHelper (EOEntity entity)
static ERXSQLHelper newSQLHelper (JDBCPlugIn plugin)
static ERXSQLHelper newSQLHelper (JDBCAdaptor adaptor)
static ERXSQLHelper newSQLHelper (EOAdaptorChannel adaptorChannel)
static ERXSQLHelper newSQLHelper (EOAdaptor adaptor)
static ERXSQLHelper newSQLHelper (EODatabaseChannel databaseChannel)
static ERXSQLHelper newSQLHelper (EODatabaseContext databaseContext)
static ERXSQLHelper newSQLHelper (EOEditingContext ec, EOModel model)
static ERXSQLHelper newSQLHelper (EOEditingContext ec, EOEntity entity)
static ERXSQLHelper newSQLHelper (EOEditingContext ec, String modelName)
static ERXSQLHelper newSQLHelper (EOSQLExpression expression)

Static Public Attributes

static final Logger log = Logger.getLogger(ERXSQLHelper.class)

Protected Member Functions

boolean canReliablyPerformDistinctWithSortOrderings ()
ColumnIndex[] columnIndexesFromColumnNames (String...columnNames)
char commandSeparatorChar ()
String commandSeparatorString ()
Pattern commentPattern ()
String formatValueForAttribute (EOSQLExpression expression, Object value, EOAttribute attribute, String key)
int maximumElementPerInClause (EOEntity entity)
String sqlForGetNextValFromSequencedNamed (String sequenceName)
String sqlForSubquery (String subquery, String alias)

Private Member Functions

EODatabaseContext databaseContextForModel (EOModel model, EOObjectStoreCoordinator coordinator)

Static Private Attributes

static Map< String, ERXSQLHelper_sqlHelperMap = new HashMap<String, ERXSQLHelper>()


Member Function Documentation

int _groupByOrHavingIndex ( EOSQLExpression  expression  ) 

Returns the index in the expression's statement where group by and having clauses should be inserted.

Parameters:
expression the expression to look into
Returns:
the index into statement where the group by should be inserted

int _orderByIndex ( EOSQLExpression  expression  ) 

Returns the index in the expression's statement where order by clauses should be inserted.

Parameters:
expression the expression to look into
Returns:
the index into statement where the order by should be inserted

void addGroupByClauseToExpression ( NSArray< EOAttribute >  attributes,
EOSQLExpression  expression 
)

Adds a group-by clause to the given SQL Expression based on the given list of attributes.

Parameters:
attributes the list of attributes to group by
expression the sql expression to add a "group by" clause to

void addGroupByClauseToExpression ( EOEditingContext  editingContext,
EOFetchSpecification  fetchSpec,
EOSQLExpression  expression 
)

Adds a group-by clause to the given SQL Expression based on the list of attributes defined in the given fetch spec.

Parameters:
editingContext the editing context to lookup entities with
fetchSpec the fetch spec to retrieve attributes from
expression the sql expression to add a "group by" clause to

void addHavingCountClauseToExpression ( NSSelector  selector,
int  value,
EOSQLExpression  expression 
)

Adds a " having count(*) > x" clause to a group by expression.

Parameters:
selector the comparison selector -- just like EOKeyValueQualifier
value the value to compare against
expression the expression to modify

void appendItemToListString ( String  itemString,
StringBuffer  listString 
)

Adds itemString to a comma-separated list. If listString already has entries, this method appends a comma followed by itemString. There is no good way to hook in and use EOSQLExpression's version of this, so we have our own copy of it.

Parameters:
itemString the item to append
listString the list buffer

NSArray<EOAttribute> attributesToFetchForEntity ( EOFetchSpecification  fetchSpec,
EOEntity  entity 
)

Returns the last of attributes to fetch for a fetch spec. The entity is passed in here because it has likely already been looked up for the particular fetch spec.

Parameters:
fetchSpec the fetch spec
entity the entity (which should match fetchSpec.entityName())
Returns:
the list of attributes to fetch

boolean canReliablyPerformDistinctWithSortOrderings (  )  [protected]

Returns whether or not this database can always perform the a distinct operation when sort orderings are applied. Oracle, for instance, will fail if you try to sort on a key that isn't in the list of fetched keys.

Returns:
whether or not this database can always perform the a distinct operation when sort orderings are applied

Reimplemented in ERXSQLHelper.OracleSQLHelper.

ColumnIndex [] columnIndexesFromColumnNames ( String...  columnNames  )  [protected]

NSMutableArray<String> columnNamesFromColumnIndexes ( ColumnIndex...  columnIndexes  ) 

char commandSeparatorChar (  )  [protected]

This is totally cheating ... But I just need the separator character for now. We can rewrite the script parser later. Actually, somewhere on earth there is already a sql parser or two. Probably worth getting that one.

Returns:
the separator character used by this database

Reimplemented in ERXSQLHelper.OracleSQLHelper.

String commandSeparatorString (  )  [protected]

Reimplemented in ERXSQLHelper.OracleSQLHelper.

Pattern commentPattern (  )  [protected]

Returns a pattern than matches only blank lines. Subclasses should implement this to return a pattern matching the vendor specific comment indicator(s).

Returns:
regex pattern that indicates this line is an SQL comment

Reimplemented in ERXSQLHelper.FrontBaseSQLHelper, ERXSQLHelper.MySQLSQLHelper, and ERXSQLHelper.MicrosoftSQLHelper.

String createDependentSchemaSQLForEntities ( NSArray< EOEntity >  entities,
EOAdaptor  adaptor 
)

Generates table create statements for a set of entities, then finds all the entities that those entities depend on (in other models) and generates foreign key statements for those, so you can generate sql for cross-model.

Parameters:
entities the entities to generate for
adaptor the adaptor to use
Returns:
the sql script

String createIndexSQLForEntities ( NSArray< EOEntity >  entities,
NSArray< String externalTypesToIgnore 
)

Reimplemented in ERXSQLHelper.OracleSQLHelper.

String createIndexSQLForEntities ( NSArray< EOEntity >  entities  ) 

String createSchemaSQLForEntitiesInDatabaseContext ( NSArray< EOEntity >  entities,
EODatabaseContext  databaseContext,
boolean  create,
boolean  drop 
)

creates SQL to create tables for the specified Entities. This can be used with EOUtilities rawRowsForSQL method to create the tables.

Parameters:
entities a NSArray containing the entities for which create table statements should be generated or null if all entitites in the model should be used.
databaseContext the databaseContext
create if true, tables and keys are created
drop if true, tables and keys are dropped
Returns:
a String containing SQL statements to create tables

String createSchemaSQLForEntitiesInModel ( NSArray< EOEntity >  entities,
EOModel  model 
)

Creates SQL to create tables for the specified Entities. This can be used with EOUtilities rawRowsForSQL method to create the tables.

Parameters:
entities a NSArray containing the entities for which create table statements should be generated or null if all entitites in the model should be used.
model the EOModel
Returns:
a String containing SQL statements to create tables

String createSchemaSQLForEntitiesInModelAndOptions ( NSArray< EOEntity >  entities,
EOModel  model,
NSDictionary  optionsCreate 
)

creates SQL to create tables for the specified Entities. This can be used with EOUtilities rawRowsForSQL method to create the tables.

Parameters:
entities a NSArray containing the entities for which create table statements should be generated or null if all entitites in the model should be used.
model the EOModel
optionsCreate a NSDictionary containing the different options
Returns:
a String containing SQL statements to create tables

String createSchemaSQLForEntitiesInModelWithName ( NSArray< EOEntity >  entities,
String  modelName 
)

creates SQL to create tables for the specified Entities. This can be used with EOUtilities rawRowsForSQL method to create the tables.

Parameters:
entities a NSArray containing the entities for which create table statements should be generated or null if all entitites in the model should be used.
modelName the name of the EOModel
Returns:
a String containing SQL statements to create tables

String createSchemaSQLForEntitiesInModelWithNameAndOptions ( NSArray< EOEntity >  entities,
String  modelName,
NSDictionary  optionsCreate 
)

creates SQL to create tables for the specified Entities. This can be used with EOUtilities rawRowsForSQL method to create the tables.

Parameters:
entities a NSArray containing the entities for which create table statements should be generated or null if all entitites in the model should be used.
modelName the name of the EOModel
optionsCreate 
Returns:
a String containing SQL statements to create tables

Reimplemented in ERXSQLHelper.OracleSQLHelper.

String createSchemaSQLForEntitiesWithOptions ( NSArray< EOEntity >  entities,
EOAdaptor  adaptor,
NSDictionary< String, String optionsDictionary 
)

Creates the schema sql for a set of entities.

Parameters:
entities the entities to create sql for
adaptor the adaptor to use
optionsDictionary the options (
See also:
createSchemaSQLForEntitiesInModelWithNameAndOptions)
Returns:
a sql script

String createSchemaSQLForEntitiesWithOptions ( NSArray< EOEntity >  entities,
EODatabaseContext  databaseContext,
NSDictionary< String, String optionsCreate 
)

Creates the schema sql for a set of entities.

Parameters:
entities the entities to create sql for
databaseContext the database context to use
optionsCreate the options (
See also:
createSchemaSQLForEntitiesInModelWithNameAndOptions)
Returns:
a sql script

String customQueryExpressionHintAsString ( Object  hint  ) 

Returns the custom query expression hint as a String. At the moment, if it's an EOSQLExpression, it just returns .statement().

Parameters:
hint the hint to convert to a String
Returns:
the hint as a String

EODatabaseContext databaseContextForModel ( EOModel  model,
EOObjectStoreCoordinator  coordinator 
) [private]

Reimplementation that does not try to the shared objects. You should exit soon after calling this, as it may or may not leave channels open. It is simply to geenrate sql.

Parameters:
model 
coordinator 
Returns:
the database context for the given model

NSMutableDictionary<String, String> defaultOptionDictionary ( boolean  create,
boolean  drop 
)

Creates an option dictionary to use with the other methods

Parameters:
create add create statements
drop add drop statements

This method uses the following defaults options:
  • EOSchemaGeneration.DropTablesKey=YES if drop
  • EOSchemaGeneration.DropPrimaryKeySupportKey=YES if drop
  • EOSchemaGeneration.CreateTablesKey=YES if create
  • EOSchemaGeneration.CreatePrimaryKeySupportKey=YES if create
  • EOSchemaGeneration.PrimaryKeyConstraintsKey=YES if create
  • EOSchemaGeneration.ForeignKeyConstraintsKey=YES if create
  • EOSchemaGeneration.CreateDatabaseKey=NO
  • EOSchemaGeneration.DropDatabaseKey=NO


Possible values are YES and NO
Returns:
a String containing SQL statements to create tables

String externalTypeForJDBCType ( JDBCAdaptor  adaptor,
int  jdbcType 
)

JDBCAdaptor.externalTypeForJDBCType just returns the first type it finds instead of trying to find a best match. This can still fail, mind you, but it should be much better than the EOF default impl.

Parameters:
adaptor the adaptor to retrieve an external type for
jdbcType the JDBC type number
Returns:
a guess at the external type name to use

Reimplemented in ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.DerbySQLHelper, ERXSQLHelper.MySQLSQLHelper, ERXSQLHelper.PostgresqlSQLHelper, and ERXSQLHelper.MicrosoftSQLHelper.

String formatValueForAttribute ( EOSQLExpression  expression,
Object  value,
EOAttribute  attribute,
String  key 
) [protected]

Number getNextValFromSequenceNamed ( EOEditingContext  ec,
String  modelName,
String  sequenceName 
)

Convenience method to get the next unique ID from a sequence.

Parameters:
ec editing context
modelName name of the model which connects to the database that has the sequence in it
sequenceName name of the sequence
Returns:
next value in the sequence

boolean handleDatabaseException ( EODatabaseContext  databaseContext,
Throwable  throwable 
)

Returns true if the SQL helper can handle the exception. Typical uses are morphing unique constraints to NSValidation exceptions.

Parameters:
databaseContext 
throwable 
Returns:
whether or not the SQL helper can handl this exception

int jdbcTypeForCustomType ( int  jdbcType  ) 

Returns the JDBC type to use for a given ERXSQLHelper custom type

Parameters:
jdbcType the ERXSQLHelper custom type
Returns:
the JDBC type to use

String limitExpressionForSQL ( EOSQLExpression  expression,
EOFetchSpecification  fetchSpecification,
String  sql,
long  start,
long  end 
)

int maximumElementPerInClause ( EOEntity  entity  )  [protected]

The database specific limit, or or most efficient number, of elements in an IN clause in a statement. If there are more that this number of elements, additional IN clauses will be generated, ORed to the others.

Parameters:
entity EOEntity that can be used to fine-tune the result
Returns:
database specific limit, or or most efficient number, of elements in an IN clause in a statement

Reimplemented in ERXSQLHelper.FrontBaseSQLHelper.

String migrationTableName (  ) 

Returns the name of the table to use for database migrations.

Returns:
the name of the table to use for database migrations

Reimplemented in ERXSQLHelper.OracleSQLHelper, and ERXSQLHelper.DerbySQLHelper.

static ERXSQLHelper newSQLHelper ( String  databaseProductName  )  [static]

static ERXSQLHelper newSQLHelper ( EOModel  model  )  [static]

static ERXSQLHelper newSQLHelper ( EOEntity  entity  )  [static]

static ERXSQLHelper newSQLHelper ( JDBCPlugIn  plugin  )  [static]

static ERXSQLHelper newSQLHelper ( JDBCAdaptor  adaptor  )  [static]

static ERXSQLHelper newSQLHelper ( EOAdaptorChannel  adaptorChannel  )  [static]

static ERXSQLHelper newSQLHelper ( EOAdaptor  adaptor  )  [static]

static ERXSQLHelper newSQLHelper ( EODatabaseChannel  databaseChannel  )  [static]

static ERXSQLHelper newSQLHelper ( EODatabaseContext  databaseContext  )  [static]

static ERXSQLHelper newSQLHelper ( EOEditingContext  ec,
EOModel  model 
) [static]

static ERXSQLHelper newSQLHelper ( EOEditingContext  ec,
EOEntity  entity 
) [static]

static ERXSQLHelper newSQLHelper ( EOEditingContext  ec,
String  modelName 
) [static]

static ERXSQLHelper newSQLHelper ( EOSQLExpression  expression  )  [static]

void prepareConnectionForSchemaChange ( EOEditingContext  ec,
EOModel  model 
)

String quoteColumnName ( String  columnName  ) 

String readFormatForAggregateFunction ( String  functionName,
String  columnName,
String  aggregateName 
)

Returns the attribute read format for an aggregate function for a particular column with a name.

Parameters:
functionName the aggregate function to generate
columnName the column name to aggregate on
aggregateName the name to assign to the aggregate result
Returns:
the generated read format

boolean reassignExternalTypeForValueTypeOverride ( EOAttribute  attribute  ) 

void removeSelectFromExpression ( EOAttribute  attribute,
EOSQLExpression  sqlExpression 
)

Removes an attribute from the select list.

Parameters:
attribute the attribute to remove from the select list
sqlExpression the expression to remove from

void restoreConnectionSettingsAfterSchemaChange ( EOEditingContext  ec,
EOModel  model 
)

int rowCountForFetchSpecification ( EOEditingContext  ec,
EOFetchSpecification  spec 
)

Returns the number of rows the supplied EOFetchSpecification would return.

Parameters:
ec the EOEditingContext
spec the EOFetchSpecification in question
Returns:
the number of rows

boolean shouldExecute ( String  sql  ) 

boolean shouldPerformDistinctInMemory ( EOFetchSpecification  fetchSpecification  ) 

Returns whether or not this database should perform the distinct portion of the given fetch spec in memory or not.

Parameters:
fetchSpecification the fetch spec to check
Returns:
whether or not this database should perform the distinct portion of the given fetch spec in memory or not

NSArray<String> splitSQLStatements ( String  sql  ) 

Splits semicolon-separate sql statements into an array of strings

Parameters:
sql a multi-line sql statement
Returns:
an array of sql statements

NSArray<String> splitSQLStatementsFromFile ( File  f  )  throws IOException

Splits the SQL statements from the given file.

Parameters:
f the file to read from
Returns:
an array of SQL statements
Exceptions:
IOException if there is a problem reading the stream

NSArray<String> splitSQLStatementsFromInputStream ( InputStream  is  )  throws IOException

Splits the SQL statements from the given input stream

Parameters:
is the input stream to read from
Returns:
an array of SQL statements
Exceptions:
IOException if there is a problem reading the stream

EOSQLExpression sqlExpressionForFetchSpecification ( EOEditingContext  ec,
EOFetchSpecification  spec,
long  start,
long  end,
NSArray< EOAttribute >  attributes 
)

Creates the SQL which is used by the provided EOFetchSpecification, limited by the given range.

Parameters:
ec the EOEditingContext
spec the EOFetchSpecification in question
start start of rows to fetch
end end of rows to fetch (-1 if not used)
attributes the attributes to fetch from the given entity
Returns:
the EOSQLExpression which the EOFetchSpecification would use

EOSQLExpression sqlExpressionForFetchSpecification ( EOEditingContext  ec,
EOFetchSpecification  spec,
long  start,
long  end 
)

Creates the SQL which is used by the provided EOFetchSpecification, limited by the given range.

Parameters:
ec the EOEditingContext
spec the EOFetchSpecification in question
start start of rows to fetch
end end of rows to fetch (-1 if not used)
Returns:
the EOSQLExpression which the EOFetchSpecification would use

String sqlForCreateIndex ( String  indexName,
String  tableName,
ColumnIndex...  columnIndexes 
)

Returns the SQL expression for creating an index on the given set of columns

Parameters:
indexName the name of the index to create
tableName the name of the containing table
columnIndexes the list of columns to index on
Returns:
a SQL expression

Reimplemented in ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.FrontBaseSQLHelper, ERXSQLHelper.MySQLSQLHelper, ERXSQLHelper.PostgresqlSQLHelper, and ERXSQLHelper.NoSQLHelper.

String sqlForCreateIndex ( String  indexName,
String  tableName,
String...  columnNames 
)

Returns the SQL expression for creating an index on the given set of columns

Parameters:
indexName the name of the index to create
tableName the name of the containing table
columnNames the list of column names to index on
Returns:
a SQL expression

String sqlForCreateUniqueIndex ( String  indexName,
String  tableName,
ColumnIndex...  columnIndexes 
)

Returns the SQL expression for creating a unique index on the given set of columns

Parameters:
indexName the name of the index to create
tableName the name of the containing table
columnIndexes the list of columns to index on
Returns:
a SQL expression

Reimplemented in ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.DerbySQLHelper, ERXSQLHelper.FrontBaseSQLHelper, ERXSQLHelper.MySQLSQLHelper, and ERXSQLHelper.PostgresqlSQLHelper.

String sqlForCreateUniqueIndex ( String  indexName,
String  tableName,
String...  columnNames 
)

Returns the SQL expression for creating a unique index on the given set of columns

Parameters:
indexName the name of the index to create
tableName the name of the containing table
columnNames the list of column names to index on
Returns:
a SQL expression

String sqlForFullTextQuery ( ERXFullTextQualifier  qualifier,
EOSQLExpression  expression 
)

Returns the SQL expression for a full text search query.

Parameters:
qualifier the full text qualifier
expression the EOSQLExpression context
Returns:
a SQL expression

Reimplemented in ERXSQLHelper.FrontBaseSQLHelper.

String sqlForGetNextValFromSequencedNamed ( String  sequenceName  )  [protected]

Returns the SQL required to select the next value from the given sequence. This should return a single row with a single column.

Parameters:
sequenceName the name of the sequence
Returns:
the next sequence value

Reimplemented in ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.FrontBaseSQLHelper, and ERXSQLHelper.PostgresqlSQLHelper.

String sqlForRegularExpressionQuery ( String  key,
String  value 
)

Returns the SQL expression for a regular expression query.

Parameters:
key 
value 
Returns:
the regex SQL

Reimplemented in ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.MySQLSQLHelper, and ERXSQLHelper.PostgresqlSQLHelper.

String sqlForSubquery ( String  subquery,
String  alias 
) [protected]

Returns the syntax for using the given query as an aliased subquery in a from-clause.

Parameters:
subquery the subquery to wrap
alias the alias to use
Returns:
the formatted subquery expression

Reimplemented in ERXSQLHelper.OracleSQLHelper.

String sqlWhereClauseStringForKey ( EOSQLExpression  e,
String  key,
NSArray  valueArray 
)

Creates a where clause string " someKey IN ( someValue1,...)". Can migrate keyPaths.

Parameters:
e the SQL expression
key the name of the key
valueArray an array of values to generate an "in" clause for
Returns:
the where clause for the given key

int varcharLargeColumnWidth (  ) 

Returns the width that should be used for a varcharLarge column in migrations.

Returns:
the width that should be used for a varcharLarge column in migrations

Reimplemented in ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.DerbySQLHelper, ERXSQLHelper.MySQLSQLHelper, and ERXSQLHelper.PostgresqlSQLHelper.

int varcharLargeJDBCType (  ) 

Returns the JDBCType that should be used for a varcharLarge column in migrations.

Returns:
the JDBCType that should be used for a varcharLarge column in migrations

Reimplemented in ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.H2SQLHelper, ERXSQLHelper.DerbySQLHelper, ERXSQLHelper.MySQLSQLHelper, and ERXSQLHelper.PostgresqlSQLHelper.


Member Data Documentation

Map<String, ERXSQLHelper> _sqlHelperMap = new HashMap<String, ERXSQLHelper>() [static, private]

final Logger log = Logger.getLogger(ERXSQLHelper.class) [static]

logging support


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:15 2012 for Project Wonder by  doxygen 1.5.8