|
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.OpenBasePlugIn.OpenBaseExpression
public static class OpenBasePlugIn.OpenBaseExpression
| 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 | |
|---|---|
OpenBasePlugIn.OpenBaseExpression(EOEntity entity)
|
|
| Method Summary | |
|---|---|
void |
addUpdateListAttribute(EOAttribute attribute,
Object value)
Adds an attribute-value assignment ("LAST_NAME = 'Thomas'", for example) to a comma-separated list for use in an UPDATE statement. |
String |
assembleInsertStatementWithRow(NSDictionary nsdictionary,
String s,
String s1,
String s2)
This method is invoked from prepareInsertExpressionWithRow to return an SQL INSERT statement. |
String |
assembleJoinClause(String leftName,
String rightName,
int semantic)
This method is invoked from addJoinClause to return a JOIN clause. |
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 nsdictionary,
EOQualifier eoqualifier,
String s,
String s1,
String s2)
This method is invoked from prepareUpdateExpressionWithRow to return an SQL UPDATE statement. |
NSMutableDictionary |
bindVariableDictionaryForAttribute(EOAttribute attribute,
Object value)
Implemented by subclasses to create and return the bind variable dictionary for attribute and value. |
NSMutableDictionary |
bindVariableDictionaryForInsertOrUpdateAttribute(EOAttribute attribute,
Object value)
|
void |
prepareInsertExpressionWithRow(NSDictionary nsdictionary)
Generates an INSERT statement. |
void |
prepareSelectExpressionWithAttributes(NSArray attributes,
boolean lock,
EOFetchSpecification fetchSpec)
Generates a SELECT statement. |
void |
prepareUpdateExpressionWithRow(NSDictionary row,
EOQualifier qualifier)
Generates an UPDATE statement. |
char |
sqlEscapeChar()
Returns the char used for the ESCAPE clause in an SQL LIKE expression. |
String |
sqlStringForCaseInsensitiveLike(String valueString,
String keyString)
Overridden by subclasses to return a case insensitive comparison of valueString and keyString. |
String |
sqlStringForForInsertOrUpdateValue(Object value,
String keyPath)
|
| Methods inherited from class com.webobjects.jdbcadaptor.JDBCExpression |
|---|
addSelectListAttribute, allowsNullClauseForConstraint, appendItemToListString, appendItemToOrderByString, appendItemToValueListString, columnTypeStringForAttribute, externalNameQuoteCharacter, formatValueForAttribute, jdbcInfo, lockClause, mustUseBindVariableForAttribute, setJDBCInfo, shouldUseBindVariableForAttribute, useBindVariables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OpenBasePlugIn.OpenBaseExpression(EOEntity entity)
| Method Detail |
|---|
public char sqlEscapeChar()
EOSQLExpression
sqlEscapeChar in class EOSQLExpression
public String sqlStringForCaseInsensitiveLike(String valueString,
String keyString)
EOSQLExpressionvalueString and keyString. For example, a subclass implementation might return the string "UPPER(keyString) LIKE UPPER(valueString)".
sqlStringForCaseInsensitiveLike in class EOSQLExpressionvalueString - specifies valueStringkeyString - specifies keyString
valueString and keyString
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)
EOSQLExpressionprepareSelectExpressionWithAttributes to return an SQL SELECT statement. The statment is of the form:
SELECT columnList
FROM tableList lockClause
WHERE whereClause AND joinClause
ORDER BY orderByClause
If 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 EOSQLExpressionattributes - 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 String assembleJoinClause(String leftName,
String rightName,
int semantic)
EOSQLExpressionaddJoinClause to return a JOIN clause. The clause is of the form:
leftName <i>operator</i> rightName
where operator is "=" for an inner join, "*=" for a left-outer join, and "=*" for a right-outer join.
assembleJoinClause in class EOSQLExpressionleftName - specifies leftnamerightName - specifies rightnamesemantic - specifies semantic
EOSQLExpression.addJoinClause(String aString, String aString, int anInt)
public void prepareSelectExpressionWithAttributes(NSArray attributes,
boolean lock,
EOFetchSpecification fetchSpec)
EOSQLExpressionaddSelectListAttribute for each entry in attributes to prepare the comma-separated list of attributes.fetchSpec's qualifier to generate the receiver's whereClauseString}.addOrderByAttributeOrdering for each EOAttributeOrdering object in fetchSpec. First conjoins the qualifier in fetchSpec with the restricting qualifier, if any, of the receiver's entity.joinExpression to generate the receiver's joinClauseString.tableListWithRootEntity to get the comma-separated list of tables for the FROM clause.lock is true, invokes lockClause to get the SQL string to lock selected rows.assembleSelectStatementWithAttributes.
prepareSelectExpressionWithAttributes in class JDBCExpressionattributes - specifies array of attributeslock - specifies flagfetchSpec - specifies fetch specificationEOSQLExpressionFactory.selectStatementForAttributes(NSArray attributes, boolean bool, EOFetchSpecification fetchSpec, EOEntity entity),
EOSQLExpression.assembleSelectStatementWithAttributes(NSArray attributes, boolean lock, EOQualifier qualifier, NSArray fetchOrder, String selectString, String columnList, String tableList, String whereClause, String joinClause, String orderByClause, String lockClause),
EOSQLExpression.addSelectListAttribute(EOAttribute anEOAttribute),
EOSQLExpression.whereClauseString(),
EOSQLExpression.addOrderByAttributeOrdering(EOSortOrdering sortOrdering),
EOSQLExpression.joinExpression(),
EOSQLExpression.joinClauseString(),
EOSQLExpression.tableListWithRootEntity(EOEntity entity),
EOSQLExpression.lockClause()public void prepareInsertExpressionWithRow(NSDictionary nsdictionary)
EOSQLExpressionaddInsertListAttribute for each entry in row to prepare the comma-separated list of attributes and the corresponding list of values.tableListWithRootEntity to get the table name.assembleInsertStatementWithRow.
prepareInsertExpressionWithRow in class EOSQLExpressionnsdictionary - specifies row which is to be insertedEOSQLExpression.addInsertListAttribute(EOAttribute anEOAttribute, Object anObject),
EOSQLExpression.assembleInsertStatementWithRow(NSDictionary row , String tableList, String columnList, String valueList),
EOSQLExpression.tableListWithRootEntity(EOEntity entity),
EOSQLExpressionFactory.insertStatementForRow(NSDictionary row, EOEntity entity)
public String assembleInsertStatementWithRow(NSDictionary nsdictionary,
String s,
String s1,
String s2)
EOSQLExpressionprepareInsertExpressionWithRow to return an SQL INSERT statement. The statement is of the form:
INSERT INTO tableList (columnList) VALUES valueList
or, if columnList is null:
INSERT INTO
tableList
VALUES
valueList
assembleInsertStatementWithRow in class EOSQLExpressionnsdictionary - an NSDictionary containing the row datas - SQL table lists1 - SQL column lists2 - SQL value list
EOSQLExpression.prepareInsertExpressionWithRow(NSDictionary row)
public void prepareUpdateExpressionWithRow(NSDictionary row,
EOQualifier qualifier)
EOSQLExpressionaddUpdateListAttribute for each entry in row to prepare the comma-separated list of "attribute = value" assignments.whereClauseString using qualifer.tableListWithRootEntity to get the table name for the FROM clause.assembleUpdateStatementWithRow.
prepareUpdateExpressionWithRow in class EOSQLExpressionrow - specifies row in which update will occurqualifier - specifies qualifier which generates the receiver's whereClauseStringEOSQLExpressionFactory.updateStatementForRow( NSDictionary row, EOQualifier qualifier, EOEntity entity),
EOSQLExpression.addUpdateListAttribute(EOAttribute attribute, Object value),
EOSQLExpression.whereClauseString(),
EOSQLExpression.tableListWithRootEntity(EOEntity entity),
EOSQLExpression.lockClause(),
EOSQLExpression.assembleUpdateStatementWithRow(NSDictionary row, EOQualifier qualifier, String tableList, String updateList, String whereClause)
public String assembleUpdateStatementWithRow(NSDictionary nsdictionary,
EOQualifier eoqualifier,
String s,
String s1,
String s2)
EOSQLExpressionprepareUpdateExpressionWithRow 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 EOSQLExpressionnsdictionary - an NSDictionary containing the row dataeoqualifier - an EOQualifier for finding the row to updates - SQL table lists1 - SQL update lists2 - SQL where clause
EOSQLExpression.prepareUpdateExpressionWithRow(NSDictionary row, EOQualifier qualifier)
public void addUpdateListAttribute(EOAttribute attribute,
Object value)
EOSQLExpressionvalue with attribute's "write" format. Method listString can be used to access the list. This method invokes
appendItemToListString to add the attribute-value assignment.
addUpdateListAttribute in class EOSQLExpressionattribute - the EOAttribute that contributes the left-hand-side of the assignmentvalue - the value that contributes the right-hand-side of the assignmentEOSQLExpression.listString(),
EOSQLExpression.appendItemToListString(String aString, StringBuffer aStringBuffer),
EOSQLExpression.formatSQLString(String sqlString, String format),
EOAttribute.writeFormat()
public String sqlStringForForInsertOrUpdateValue(Object value,
String keyPath)
public NSMutableDictionary bindVariableDictionaryForInsertOrUpdateAttribute(EOAttribute attribute,
Object value)
public NSMutableDictionary bindVariableDictionaryForAttribute(EOAttribute attribute,
Object value)
EOSQLExpressionattribute and value. The dictionary returned from this method must contain the following key-value pairs:
| Key | Corresponding Value | |
|---|---|---|
| BindVariableNameKey | Name of the bind variable for attribute | |
| BindVariablePlaceHolderKey | Placeholder string used in the SQL statement | |
| BindVariableAttributeKey | attribute |
|
| BindVariableValueKey | value |
An adaptor subclass may define additional entries as required by its RDBMS.
Invoked from sqlStringForValue when the message mustUseBindVariableForAttribute returns true or when the receiver's class uses bind variables and the message shouldUseBindVariableForAttribute returns true.
bindVariableDictionaryForAttribute in class JDBCExpressionattribute - the EOAttribute associated with the bind variable dictionaryvalue - the value associated with the bind variable dictionary
attribute and valueEOSQLExpression.useBindVariables(),
EOSQLExpression.sqlStringForValue(Object value, String keyPath),
EOSQLExpression.mustUseBindVariableForAttribute(EOAttribute attribute),
EOSQLExpression.shouldUseBindVariableForAttribute(EOAttribute attribute),
EOSQLExpression
|
Last updated June 2008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||