|
WebObjects 5.4.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.eoaccess.EOSQLExpression
com.webobjects.jdbcadaptor.JDBCExpression
com.webobjects.jdbcadaptor.FrontbasePlugIn.FrontbaseExpression
public static class FrontbasePlugIn.FrontbaseExpression
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.webobjects.eoaccess.EOSQLExpression |
---|
EOSQLExpression.SQLValue |
Field Summary |
---|
Fields inherited from class com.webobjects.eoaccess.EOSQLExpression |
---|
BindVariableAttributeKey, BindVariableColumnKey, BindVariableNameKey, BindVariablePlaceHolderKey, BindVariableValueKey |
Constructor Summary | |
---|---|
FrontbasePlugIn.FrontbaseExpression(EOEntity eoentity)
|
Method Summary | |
---|---|
void |
addOrderByAttributeOrdering(EOSortOrdering eosortordering)
Adds an attribute-direction pair ("LAST_NAME asc", for example) to the receiver's ORDER BY string. |
String |
assembleDeleteStatementWithQualifier(EOQualifier eoqualifier,
String table,
String qualifier)
This method is invoked from prepareDeleteExpressionForQualifier to return an SQL DELETE statement. |
String |
assembleInsertStatementWithRow(NSDictionary nsdictionary,
String table,
String columns,
String values)
This method is invoked from prepareInsertExpressionWithRow to return an SQL INSERT statement. |
String |
assembleSelectStatementWithAttributes(NSArray attributes,
boolean lock,
EOQualifier qualifier,
NSArray fetchOrder,
String selectString,
String columnList,
String tableList,
String whereClause,
String joinClause,
String orderByClause,
String lockClause)
This method is invoked from prepareSelectExpressionWithAttributes to return an SQL SELECT statement. |
String |
assembleUpdateStatementWithRow(NSDictionary dictionary,
EOQualifier qualifier,
String table,
String values,
String sqlQualifier)
This method is invoked from prepareUpdateExpressionWithRow to return an SQL UPDATE statement. |
String |
externalNameQuoteCharacter()
Returns a String with the character used to quote SQL identifiers that use unusual characters which would not otherwise be legal. |
String |
formatValueForAttribute(Object obj,
EOAttribute eoattribute)
This method should be overridden by subclasses to return a string representation of value suitable for use in an SQL statement, depending on attribute 's externalType . |
String |
lockClause()
Overridden by subclasses to return the SQL string used in a SELECT statement to lock selected rows. |
boolean |
mustUseBindVariableForAttribute(EOAttribute eoattribute)
Returns true if the receiver must use bind variables for attribute , false otherwise. |
boolean |
shouldUseBindVariableForAttribute(EOAttribute eoattribute)
Returns true if the receiver can provide a bind variable dictionary for attribute , false otherwise. |
String |
sqlStringForAttribute(EOAttribute attribute)
Returns the SQL string for attribute , complete with a table alias if the receiver uses table aliases. |
String |
sqlStringForCaseInsensitiveLike(String value,
String column)
Overridden by subclasses to return a case insensitive comparison of valueString and keyString . |
String |
sqlStringForKeyValueQualifier(EOKeyValueQualifier eokeyvaluequalifier)
Creates and returns a SQL string that is the result of interposing an operator between the SQL strings for qualifier 's key and value. |
String |
sqlStringForSelector(NSSelector qualifierOperator,
Object value)
Returns a SQL operator for selector and value . |
boolean |
useBindVariables()
Queries if instances use bind variables. |
Methods inherited from class com.webobjects.jdbcadaptor.JDBCExpression |
---|
addSelectListAttribute, allowsNullClauseForConstraint, appendItemToListString, appendItemToOrderByString, appendItemToValueListString, bindVariableDictionaryForAttribute, columnTypeStringForAttribute, jdbcInfo, prepareSelectExpressionWithAttributes, setJDBCInfo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FrontbasePlugIn.FrontbaseExpression(EOEntity eoentity)
Method Detail |
---|
public String sqlStringForSelector(NSSelector qualifierOperator, Object value)
EOSQLExpression
selector
and value
. The possible values for selector
are defined as constants in EOQualifier. The following table summarizes EOSQLExpression's default mapping:
Selector (EOQualifier constant) | SQL Operator | |
---|---|---|
QualifierOperatorEqual | "is" if value is NullValue , "=" otherwise |
|
QualifierOperatorNotEqual | "is not" if value is NullValue , "<>" otherwise |
|
QualifierOperatorLessThan | "<" | |
QualifierOperatorGreaterThan | ">" | |
QualifierOperatorLessThanOrEqualTo | "<=" | |
QualifierOperatorGreaterThanOrEqualTo | ">=" | |
QualifierOperatorLike | "like" |
sqlStringForSelector
in class EOSQLExpression
qualifierOperator
- specifies selectorvalue
- specifies value
selector
and value
EOSQLExpression.sqlStringForKeyComparisonQualifier(EOKeyComparisonQualifier anEOKeyComparisonQualifier)
,
EOSQLExpression.sqlStringForKeyValueQualifier(EOKeyValueQualifier qualifier)
,
EOQualifier
,
NSKeyValueCoding.NullValue
public String externalNameQuoteCharacter()
EOSQLExpression
externalNameQuoteCharacter
in class JDBCExpression
EOSQLExpression.sqlStringForSchemaObjectName(String aString)
public String sqlStringForAttribute(EOAttribute attribute)
EOSQLExpression
attribute
, complete with a table alias if the receiver uses table aliases. Invoked from sqlStringForAttributeNamed
when the attribute name is not a path.
sqlStringForAttribute
in class EOSQLExpression
attribute
- specifies EOAttribute corresponding to SQL string
attribute
EOSQLExpression.sqlStringForAttributeNamed(String name)
,
EOSQLExpression.sqlStringForAttributePath(NSArray aNSArray)
,
EOSQLExpression.useAliases()
public String assembleSelectStatementWithAttributes(NSArray attributes, boolean lock, EOQualifier qualifier, NSArray fetchOrder, String selectString, String columnList, String tableList, String whereClause, String joinClause, String orderByClause, String lockClause)
EOSQLExpression
prepareSelectExpressionWithAttributes
to return an SQL SELECT statement. The statment is of the form: IfSELECT columnList FROM tableList lockClause WHERE whereClause AND joinClause ORDER BY orderByClause
lockClause
is null
, it is omitted from the statement. Similarly, if orderByClause
is null
, the "ORDER BY orderByClause" is omitted. If either whereClause
or joinClause
is
null
, the "AND" and null
-valued argument are omitted. If both are null
, the entire WHERE clause is omitted. attributes, lock, qualifer, fetchOrder
arguments to prepareSelectExpressionWithAttributes
from which the
other assembleSelect... arguments were derived. They are provided for subclasses that need to generate the clauses of the SELECT statement in a particular way.
assembleSelectStatementWithAttributes
in class EOSQLExpression
attributes
- an NSArray of attributeslock
- flag for locking rows in databasequalifier
- an EOQualifier for selecting rowsfetchOrder
- specifies fetch orderselectString
- SQL SELECT keyword, possibly with DISTINCTcolumnList
- SQL column listtableList
- SQL table listwhereClause
- SQL WHERE clausejoinClause
- specifies join condition to add to WHERE clauseorderByClause
- SQL ORDER BY clauselockClause
- specifies clause for lock
EOSQLExpression.prepareSelectExpressionWithAttributes(NSArray attributes, boolean lock, EOFetchSpecification fetchSpec)
public void addOrderByAttributeOrdering(EOSortOrdering eosortordering)
EOSQLExpression
sortOrdering
's selector is EOSortOrdering.CompareCaseInsensitiveAscending
or EOSortOrdering.CompareCaseInsensitiveAscending
, the string
generated has the format "upper(attribute) direction". Method orderByString
can be used to access the ORDER BY string. This method invokes appendItemToListString
to add the attribute-direction pair.
addOrderByAttributeOrdering
in class EOSQLExpression
eosortordering
- the kind of sort ordering wantedEOSQLExpression.orderByString()
,
EOSQLExpression.appendItemToListString(String aString, StringBuffer aStringBuffer)
,
EOSQLExpression.sqlStringForAttributeNamed(String name)
,
EOSortOrdering
public String assembleDeleteStatementWithQualifier(EOQualifier eoqualifier, String table, String qualifier)
EOSQLExpression
prepareDeleteExpressionForQualifier
to return an SQL DELETE statement. The statement is of the form: DELETE FROM tableList SQL_WHERE whereClause
assembleDeleteStatementWithQualifier
in class EOSQLExpression
eoqualifier
- an EOQualifier for finding the row to delete the WHERE clause in a particular waytable
- SQL table listqualifier
- SQL WHERE clause
EOSQLExpression.prepareDeleteExpressionForQualifier(EOQualifier qualifier)
public String assembleInsertStatementWithRow(NSDictionary nsdictionary, String table, String columns, String values)
EOSQLExpression
prepareInsertExpressionWithRow
to return an SQL INSERT statement. The statement is of the form: or, ifINSERT INTO tableList (columnList) VALUES valueList
columnList
is null
: INSERT INTOtableList
VALUESvalueList
assembleInsertStatementWithRow
in class EOSQLExpression
nsdictionary
- an NSDictionary containing the row datatable
- SQL table listcolumns
- SQL column listvalues
- SQL value list
EOSQLExpression.prepareInsertExpressionWithRow(NSDictionary row)
public String assembleUpdateStatementWithRow(NSDictionary dictionary, EOQualifier qualifier, String table, String values, String sqlQualifier)
EOSQLExpression
prepareUpdateExpressionWithRow
to return an SQL UPDATE statement. The statement is of the form: UPDATE tableList SET updateList WHERE whereClause
row
and qualifier
are the arguments to prepareUpdateExpressionWithRow
from which updateList
and whereClause
were derived. They are provided for subclasses that need to generate the clauses of the UPDATE
statement in a particular way.
assembleUpdateStatementWithRow
in class EOSQLExpression
dictionary
- an NSDictionary containing the row dataqualifier
- an EOQualifier for finding the row to updatetable
- SQL table listvalues
- SQL update listsqlQualifier
- SQL where clause
EOSQLExpression.prepareUpdateExpressionWithRow(NSDictionary row, EOQualifier qualifier)
public String lockClause()
EOSQLExpression
lockClause
in class JDBCExpression
public boolean useBindVariables()
EOSQLExpression
useBindVariables
in class JDBCExpression
true
for JDBCEOSQLExpression.setUseBindVariables(boolean flag)
,
EOSQLExpression
public boolean shouldUseBindVariableForAttribute(EOAttribute eoattribute)
EOSQLExpression
true
if the receiver can provide a bind variable dictionary for attribute
, false
otherwise. Bind variables aren't used for values associated with this attribute when useBindVariables
returns false
.
EOSQLExpression's implementation returns false
. An SQL expression subclass should override this method to return true
if the receiver should use bind variables for attributes with attribute's
external type. It should also return true
for any attribute for which the receiver must use bind variables.
shouldUseBindVariableForAttribute
in class JDBCExpression
eoattribute
- the EOAttribute associated with the bind variable dictionary
true
for JDBCEOSQLExpression.mustUseBindVariableForAttribute(EOAttribute attribute)
,
EOSQLExpression.useBindVariables()
public boolean mustUseBindVariableForAttribute(EOAttribute eoattribute)
EOSQLExpression
true
if the receiver must use bind variables for attribute
, false
otherwise. EOSQLExpression's implementation returns false
. An SQL expression subclass that uses bind variables should override this method to return true if
the underlying RDBMS requires that bind variables be used for attributes with attribute's
external type.
mustUseBindVariableForAttribute
in class JDBCExpression
eoattribute
- the EOAttribute associated with the bind variable dictionary
true
for JDBCEOSQLExpression.shouldUseBindVariableForAttribute(EOAttribute anEOAttribute)
,
EOSQLExpression.bindVariableDictionaryForAttribute(EOAttribute attribute, Object value)
public String sqlStringForCaseInsensitiveLike(String value, String column)
EOSQLExpression
valueString
and keyString
. For example, a subclass implementation might return the string "UPPER(keyString
) LIKE UPPER(valueString
)".
sqlStringForCaseInsensitiveLike
in class EOSQLExpression
value
- specifies valueString
column
- specifies keyString
valueString
and keyString
public String sqlStringForKeyValueQualifier(EOKeyValueQualifier eokeyvaluequalifier)
EOSQLExpression
qualifier
's key and value. Determines the SQL operator by invoking sqlStringForSelector
with qualifier's
selector and value. Generates an
SQL string for qualifier's
key by invoking sqlStringForAttributeNamed
to get an SQL string and formatSQLString
with the corresponding attribute's "read" format. Similarly, generates an SQL string for qualifier's
value by invoking
sqlStringForValue
to get an SQL string and formatValueForAttribute
to format it. (First invokes sqlPatternFromShellPattern
for the value if qualifier
's selector is EOQualifier.QualifierOperatorLike
.)
sqlStringForKeyValueQualifier
in class EOSQLExpression
eokeyvaluequalifier
- specifies qualifier
qualifier's
key and valueEOSQLExpression.sqlStringForSelector(NSSelector aNSSelector, Object anObject)
,
EOSQLExpression.sqlStringForAttributeNamed(String name)
,
EOSQLExpression.formatSQLString(String sqlString, String format)
,
EOSQLExpression.sqlStringForValue(Object value, String keyPath)
,
EOSQLExpression.formatValueForAttribute(Object value, EOAttribute attribute)
,
EOSQLExpression.sqlPatternFromShellPattern(String pattern)
public String formatValueForAttribute(Object obj, EOAttribute eoattribute)
EOSQLExpression
value
suitable for use in an SQL statement, depending on attribute
's externalType
. For example, a subclass might format a date using a special database-specific
syntax or standard form or truncate numbers to attribute's precision and scale. EOSQLExpression's implementation merely returns the string representation of value
.
formatValueForAttribute
in class JDBCExpression
obj
- an object to be used in a SQL statementeoattribute
- an EOAttribute to be used in influencing the format
EOAttribute
|
Last updated June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |