
Classes | |
| class | JoinClause |
Public Member Functions | |
| void | addCreateClauseForAttribute (EOAttribute attribute) |
| void | addJoinClause (String leftName, String rightName, int semantic) |
| String | allowsNullClauseForConstraint (boolean allowsNull) |
| String | assembleJoinClause (String leftName, String rightName, int semantic) |
| String | assembleSelectStatementWithAttributes (NSArray attributes, boolean lock, EOQualifier qualifier, NSArray fetchOrder, String selectString, String columnList, String tableList, String whereClause, String joinClause, String orderByClause, String lockClause) |
| NSMutableDictionary | bindVariableDictionaryForAttribute (EOAttribute eoattribute, Object obj) |
| String | columnTypeStringForAttribute (EOAttribute attribute) |
| String | externalNameQuoteCharacter () |
| String | formatValueForAttribute (Object obj, EOAttribute eoattribute) |
| String | joinClauseString () |
| boolean | mustUseBindVariableForAttribute (EOAttribute attribute) |
| PostgresqlExpression (EOEntity entity) | |
| void | prepareConstraintStatementForRelationship (EORelationship relationship, NSArray sourceColumns, NSArray destinationColumns) |
| void | prepareSelectExpressionWithAttributes (NSArray nsarray, boolean flag, EOFetchSpecification eofetchspecification) |
| void | setUseBindVariables (boolean value) |
| boolean | shouldUseBindVariableForAttribute (EOAttribute attribute) |
| char | sqlEscapeChar () |
| String | sqlStringForAttribute (EOAttribute attribute) |
| String | sqlStringForData (NSData data) |
| String | sqlStringForSelector (NSSelector selector, Object value) |
| String | sqlStringForValue (Object v, String kp) |
| String | tableListWithRootEntity (EOEntity entity) |
| boolean | useBindVariables () |
Static Public Member Functions | |
| static String | replaceStringByStringInString (String old, String newString, String buffer) |
Static Public Attributes | |
| static final NSSelector | CASE_INSENSITIVE_REGEX_OPERATOR = new NSSelector( "~*", new Class[]{ Object.class }) |
| static final NSSelector | REGEX_OPERATOR = new NSSelector( "~", new Class[]{ Object.class }) |
Protected Member Functions | |
| boolean | shouldAllowNull (EOAttribute attribute) |
Private Member Functions | |
| String | customFunctionForStringComparison () |
| boolean | disableBindVariables () |
| boolean | disableTypeCasting () |
| boolean | enableBooleanQuoting () |
| boolean | enableIdentifierQuoting () |
| EOEntity | entityForKeyPath (String keyPath) |
| String | fixBigDecimal (BigDecimal value, EOAttribute eoattribute) |
| boolean | isDataAttribute (EOAttribute attribute) |
| boolean | isDateAttribute (EOAttribute eoattribute) |
| boolean | isTimestampAttribute (EOAttribute eoattribute) |
| NSArray | quoteArrayContents (NSArray a) |
| String | quoteIdentifier (String identifier) |
| boolean | useLowercaseForCaseInsensitiveLike () |
Private Attributes | |
| NSMutableArray | _alreadyJoined = new NSMutableArray() |
| Boolean | _disableBindVariables = null |
| Boolean | _disableTypeCasting = null |
| Boolean | _enableBooleanQuoting |
| Boolean | _enableIdentifierQuoting |
| int | _fetchLimit |
| Boolean | _useLowercaseForCaseInsensitiveLike |
Static Private Attributes | |
| static Method | _bigDecimalToString = null |
| static final NSTimestampFormatter | DATE_FORMATTER = new NSTimestampFormatter("%Y-%m-%d") |
| static final String | EXTERNAL_NAME_QUOTE_CHARACTER = "\"" |
| static final char | HEX_VALUES [] |
| static final char | SQL_ESCAPE_CHAR = '|' |
| static final NSTimestampFormatter | TIMESTAMP_FORMATTER = new NSTimestampFormatter("%Y-%m-%d %H:%M:%S.%F") |
| PostgresqlExpression | ( | EOEntity | entity | ) |
Overridden to remove the rtrim usage. The original implementation will remove every trailing space from character based column which should not be OK for Postgres.
| void addCreateClauseForAttribute | ( | EOAttribute | attribute | ) |
Overriden to not call the super implementation.
| leftName | the table name on the left side of the clause | |
| rightName | the table name on the right side of the clause | |
| semantic | the join semantic |
| String allowsNullClauseForConstraint | ( | boolean | allowsNull | ) |
cug: Quick hack for bug in WebObjects 5.4 where the "not null" statement is added without a space, and "addCreateClauseForAttribute" is not called anymore. Will probably change.
Overriden to contruct a valid SQL92 JOIN clause as opposed to the Oracle-like SQL the superclass produces.
| leftName | the table name on the left side of the clause | |
| rightName | the table name on the right side of the clause | |
| semantic | the join semantic |
| String assembleSelectStatementWithAttributes | ( | NSArray | attributes, | |
| boolean | lock, | |||
| EOQualifier | qualifier, | |||
| NSArray | fetchOrder, | |||
| String | selectString, | |||
| String | columnList, | |||
| String | tableList, | |||
| String | whereClause, | |||
| String | joinClause, | |||
| String | orderByClause, | |||
| String | lockClause | |||
| ) |
Overriden to handle correct placements of join conditions and to handle DISTINCT fetches with compareCaseInsensitiveA(De)scending sort orders.
| attributes | the attributes to select | |
| lock | flag for locking rows in the database | |
| qualifier | the qualifier to restrict the selection | |
| fetchOrder | specifies the fetch order | |
| columnList | the SQL columns to be fetched | |
| tableList | the the SQL tables to be fetched | |
| whereClause | the SQL where clause | |
| joinClause | the SQL join clause | |
| orderByClause | the SQL sort order clause | |
| lockClause | the SQL lock clause |
| NSMutableDictionary bindVariableDictionaryForAttribute | ( | EOAttribute | eoattribute, | |
| Object | obj | |||
| ) |
Overridden to fix an issue with NStimestamp classes and "T" value-typed attributes.
| String columnTypeStringForAttribute | ( | EOAttribute | attribute | ) |
Overrides the parent implementation to provide support for array data types.
| attribute | the EOattribute |
attribute | String customFunctionForStringComparison | ( | ) | [private] |
Checks the system property com.webobjects.jdbcadaptor.PostgresqlExpression.customFunctionForStringComparison to use a custom function for caseInsensitive compares and order by clauses.
This property overrides the useLowercaseForCaseInsensitiveLike definition.
null to use the default function | boolean disableBindVariables | ( | ) | [private] |
Checks the system property com.webobjects.jdbcadaptor.PostgresqlExpression.disableBindVariables to enable or disable bind variables in general.
| boolean disableTypeCasting | ( | ) | [private] |
Checks the system property com.webobjects.jdbcadaptor.PostgresqlExpression.disableTypeCasting to enable or disable typecasting (appending somepostgrestype) for attributes.
| boolean enableBooleanQuoting | ( | ) | [private] |
Checks the system property com.webobjects.jdbcadaptor.PostgresqlExpression.enableBooleanQuoting to enable or disable quoting (default) of boolean items.
| boolean enableIdentifierQuoting | ( | ) | [private] |
Checks the system property com.webobjects.jdbcadaptor.PostgresqlExpression.enableIdentifierQuoting to enable or disable quoting (default) of schema names, table names and field names. Required if names which are case sensitive or reserved words or have special characters.
| EOEntity entityForKeyPath | ( | String | keyPath | ) | [private] |
Utility that traverses a key path to find the last destination entity
| keyPath | the key path |
| String externalNameQuoteCharacter | ( | ) |
Overridden because PostgreSQL does not use the default quote character in EOSQLExpression.externalNameQuoteCharacter() which is an empty string.
| String fixBigDecimal | ( | BigDecimal | value, | |
| EOAttribute | eoattribute | |||
| ) | [private] |
Fixes an incompatibility with JDK 1.5 and using toString() instead of toPlainString() for BigDecimals. From what I understand, you will only need this if you disable bind variables.
| value | ||
| eoattribute |
| String formatValueForAttribute | ( | Object | obj, | |
| EOAttribute | eoattribute | |||
| ) |
Overridden because the original version throws when the data contains negative byte values.
| obj | the object used in the SQL statement | |
| eoattribute | the attribute associated with obj |
| boolean isDataAttribute | ( | EOAttribute | attribute | ) | [private] |
Helper to check for data columns that are not keys.
| eoattribute |
| boolean isDateAttribute | ( | EOAttribute | eoattribute | ) | [private] |
Helper to check for timestamp columns that have a "D" value type.
| eoattribute |
| boolean isTimestampAttribute | ( | EOAttribute | eoattribute | ) | [private] |
Helper to check for timestamp columns that have a "T" value type.
| eoattribute |
| String joinClauseString | ( | ) |
Overrides the parent implementation to compose the final string expression for the join clauses.
| boolean mustUseBindVariableForAttribute | ( | EOAttribute | attribute | ) |
Overridden to return true only if bind variables are enabled or the is a data type.
| void prepareConstraintStatementForRelationship | ( | EORelationship | relationship, | |
| NSArray | sourceColumns, | |||
| NSArray | destinationColumns | |||
| ) |
Overrides the parent implementation to add an INITIALLY DEFERRED to the generated statement. Useful you want to generate the schema-building SQL from a pure java environment.
cug: Also handles identifier quoting now
| relationship | the relationship | |
| sourceColumns | the source columns for the constraints | |
| destinationColumns | the destination columns for the constraints |
| void prepareSelectExpressionWithAttributes | ( | NSArray | nsarray, | |
| boolean | flag, | |||
| EOFetchSpecification | eofetchspecification | |||
| ) |
Overridden so we can get the fetch limit from the fetchSpec.
| nsarray | the array of attributes | |
| flag | locking flag | |
| eofetchspecification | the fetch specification |
| NSArray quoteArrayContents | ( | NSArray | a | ) | [private] |
Takes an array of strings and quotes every single string, if set to do so
| a | - array of strings |
Quotes the string if necessary (checks the Property)
| identifier | - the string to quote |
| static String replaceStringByStringInString | ( | String | old, | |
| String | newString, | |||
| String | buffer | |||
| ) | [static] |
Replaces a given string by another string in a string.
| old | string to be replaced | |
| newString | to be inserted | |
| buffer | string to have the replacement done on it |
| void setUseBindVariables | ( | boolean | value | ) |
Overridden to set the disableBindVariables value correctly.
| value |
| boolean shouldAllowNull | ( | EOAttribute | attribute | ) | [protected] |
| boolean shouldUseBindVariableForAttribute | ( | EOAttribute | attribute | ) |
Overridden to return true only if bind variables are enabled or the is a data type.
| char sqlEscapeChar | ( | ) |
Overridden because Postgres uses "|" instead of "\" like any other database system.
| String sqlStringForAttribute | ( | EOAttribute | attribute | ) |
Overridden because the original version does not correctly quote mixed case fields in all cases. SELECT statements were OK (useAliases is true) INSERT, UPDATE, DELETE didn't quote mixed case field names.
| attribute | the attribute (column name) to be converted to a SQL string |
| String sqlStringForData | ( | NSData | data | ) |
Overridden because the original version throws an exception when the data contains negative byte values. This method is only for smaller values like binary primary keys or such.
| data | the data to be converted to a SQL string |
| String sqlStringForSelector | ( | NSSelector | selector, | |
| Object | value | |||
| ) |
Overriden so we can put a regex-match qualifier in the display groups query bindings. You can bind '~*' or '~' to queryOperator.someKey and '.*foo' to queryMatch.someKey and will get the correct results.
| selector | the selector that specifies the SQL operator | |
| value | the value to be associated with selector |
Overrides the parent implementation to:
com.webobjects.jdbcadaptor.PostgresqlExpression.disableTypeCasting to true to disable both fixes (the former you might want to disable when PG says it can't cast a certain value and the second when you have values with a greater resolution already in the DB). | v | the value | |
| kp | the keypath associated with the value |
| String tableListWithRootEntity | ( | EOEntity | entity | ) |
Overridden because the original version does not correctly quote mixed case table names in all cases. SELECT statements were OK (useAliases is true) INSERT, UPDATE, DELETE didn't quote mixed case field names.
| boolean useBindVariables | ( | ) |
Overriddden to return the negated value of disableBindVariables().
| boolean useLowercaseForCaseInsensitiveLike | ( | ) | [private] |
Checks the system property com.webobjects.jdbcadaptor.PostgresqlExpression.useLowercaseForCaseInsensitiveLike to use the "lower" function for caseInsensitive compares
NSMutableArray _alreadyJoined = new NSMutableArray() [private] |
Holds array of join clauses.
Method _bigDecimalToString = null [static, private] |
Method to get the string value from a BigDecimals from.
Boolean _disableBindVariables = null [private] |
If true, queries will be created by using
Boolean _disableTypeCasting = null [private] |
If true, don't use typecasting, ie: 'some text'varcchar(255)
Boolean _enableBooleanQuoting [private] |
Boolean _enableIdentifierQuoting [private] |
int _fetchLimit [private] |
Fetch spec limit ivar
Boolean _useLowercaseForCaseInsensitiveLike [private] |
final NSSelector CASE_INSENSITIVE_REGEX_OPERATOR = new NSSelector( "~*", new Class[]{ Object.class }) [static] |
Selector used for case insensitive regular expressions.
final NSTimestampFormatter DATE_FORMATTER = new NSTimestampFormatter("%Y-%m-%d") [static, private] |
formatter to use when handling date columns
final String EXTERNAL_NAME_QUOTE_CHARACTER = "\"" [static, private] |
Quote character when using case sensitive queries.
final char HEX_VALUES[] [static, private] |
Initial value:
{
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'
}
final NSSelector REGEX_OPERATOR = new NSSelector( "~", new Class[]{ Object.class }) [static] |
Selector used for case sensitive regular expressions.
final char SQL_ESCAPE_CHAR = '|' [static, private] |
SQL escape character
final NSTimestampFormatter TIMESTAMP_FORMATTER = new NSTimestampFormatter("%Y-%m-%d %H:%M:%S.%F") [static, private] |
formatter to use when handling timestamps
1.5.8