Project Wonder 5.0.0.8794

er.extensions.jdbc
Class ERXSQLHelper.PostgresqlSQLHelper

java.lang.Object
  extended by er.extensions.jdbc.ERXSQLHelper
      extended by er.extensions.jdbc.ERXSQLHelper.PostgresqlSQLHelper
Enclosing class:
ERXSQLHelper

public static class ERXSQLHelper.PostgresqlSQLHelper
extends ERXSQLHelper


Nested Class Summary
 
Nested classes/interfaces inherited from class er.extensions.jdbc.ERXSQLHelper
ERXSQLHelper.ColumnIndex, ERXSQLHelper.CustomTypes, ERXSQLHelper.DerbySQLHelper, ERXSQLHelper.EROracleSQLHelper, ERXSQLHelper.FrontBaseSQLHelper, ERXSQLHelper.MicrosoftSQLHelper, ERXSQLHelper.MySQLSQLHelper, ERXSQLHelper.OpenBaseSQLHelper, ERXSQLHelper.OracleSQLHelper, ERXSQLHelper.PostgresqlSQLHelper
 
Field Summary
 
Fields inherited from class er.extensions.jdbc.ERXSQLHelper
log
 
Constructor Summary
ERXSQLHelper.PostgresqlSQLHelper()
           
 
Method Summary
 String externalTypeForJDBCType(JDBCAdaptor adaptor, int jdbcType)
          For most types, finding the type in jdbc2Info's typeInfo will provide us with a correct type mapping.
protected  String formatValueForAttribute(EOSQLExpression expression, Object value, EOAttribute attribute, String key)
           
 String limitExpressionForSQL(EOSQLExpression expression, EOFetchSpecification fetchSpecification, String sql, long start, long end)
           
 String sqlForCreateUniqueIndex(String indexName, String tableName, ERXSQLHelper.ColumnIndex... columnIndexes)
          Creates unique index; stolen from the derby helper
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.
 
Methods inherited from class er.extensions.jdbc.ERXSQLHelper
_groupByOrHavingIndex, _orderByIndex, addGroupByClauseToExpression, addGroupByClauseToExpression, addHavingCountClauseToExpression, appendItemToListString, attributesToFetchForEntity, columnIndexesFromColumnNames, columnNamesFromColumnIndexes, commandSeparatorChar, commandSeparatorString, commentPattern, createDependentSchemaSQLForEntities, createIndexSQLForEntities, createIndexSQLForEntities, createSchemaSQLForEntitiesInDatabaseContext, createSchemaSQLForEntitiesInModel, createSchemaSQLForEntitiesInModelAndOptions, createSchemaSQLForEntitiesInModelWithName, createSchemaSQLForEntitiesInModelWithNameAndOptions, createSchemaSQLForEntitiesWithOptions, createSchemaSQLForEntitiesWithOptions, customQueryExpressionHintAsString, defaultOptionDictionary, getNextValFromSequenceNamed, jdbcTypeForCustomType, migrationTableName, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, newSQLHelper, prepareConnectionForSchemaChange, readFormatForAggregateFunction, reassignExternalTypeForValueTypeOverride, removeSelectFromExpression, restoreConnectionSettingsAfterSchemaChange, rowCountForFetchSpecification, shouldExecute, splitSQLStatements, splitSQLStatementsFromFile, splitSQLStatementsFromInputStream, sqlExpressionForFetchSpecification, sqlExpressionForFetchSpecification, sqlForCreateIndex, sqlForCreateIndex, sqlForCreateUniqueIndex, sqlForFullTextQuery, sqlWhereClauseStringForKey, varcharLargeColumnWidth, varcharLargeJDBCType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXSQLHelper.PostgresqlSQLHelper

public ERXSQLHelper.PostgresqlSQLHelper()
Method Detail

sqlForGetNextValFromSequencedNamed

protected String sqlForGetNextValFromSequencedNamed(String sequenceName)
Description copied from class: ERXSQLHelper
Returns the SQL required to select the next value from the given sequence. This should return a single row with a single column.

Overrides:
sqlForGetNextValFromSequencedNamed in class ERXSQLHelper
Parameters:
sequenceName - the name of the sequence
Returns:
the next sequence value

formatValueForAttribute

protected String formatValueForAttribute(EOSQLExpression expression,
                                         Object value,
                                         EOAttribute attribute,
                                         String key)
Overrides:
formatValueForAttribute in class ERXSQLHelper

limitExpressionForSQL

public String limitExpressionForSQL(EOSQLExpression expression,
                                    EOFetchSpecification fetchSpecification,
                                    String sql,
                                    long start,
                                    long end)
Overrides:
limitExpressionForSQL in class ERXSQLHelper

sqlForRegularExpressionQuery

public String sqlForRegularExpressionQuery(String key,
                                           String value)
Description copied from class: ERXSQLHelper
Returns the SQL expression for a regular expression query.

Overrides:
sqlForRegularExpressionQuery in class ERXSQLHelper
Returns:
the regex SQL

externalTypeForJDBCType

public String externalTypeForJDBCType(JDBCAdaptor adaptor,
                                      int jdbcType)
For most types, finding the type in jdbc2Info's typeInfo will provide us with a correct type mapping. For Postgresql, it has the honor of not actually having a type named "integer," so EOF goes on a hunt for a type that MIGHT match (which is just bad, btw) and comes up with "serial". cug: There seems to be also nothing useful for "BLOB", so we return bytea for Type.BLOB; int8 for BIGINT; numeric for DECIMAL; bool for BOOLEAN We know better than EOF. For any other case, we pass it up to the default impl.

Overrides:
externalTypeForJDBCType in class ERXSQLHelper
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

sqlForCreateUniqueIndex

public String sqlForCreateUniqueIndex(String indexName,
                                      String tableName,
                                      ERXSQLHelper.ColumnIndex... columnIndexes)
Creates unique index; stolen from the derby helper

Overrides:
sqlForCreateUniqueIndex in class ERXSQLHelper
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
See Also:
er.extensions.ERXSQLHelper#sqlForCreateUniqueIndex(java.lang.String, java.lang.String, er.extensions.ERXSQLHelper.ColumnIndex[])

Last updated: Thu, Jan 8, 2009 • 12:32 PM EST

Copyright © 2002 – 2007 Project Wonder.