home *** CD-ROM | disk | FTP | other *** search
- // OracleSQLExpression.h
- // Copyright (c) 1994, NeXT Software, Inc. All rights reserved.
-
- #import <EOAccess/EOAccess.h>
-
- @class OracleColumn;
-
- // This class is used internally by the Oracle adaptor to generate Oracle
- // specific SQL.
-
- // These are the codes for internal (in the server) Oracle data types.
- // OracleServerTypes are mapped by the adaptor to the "external type" string
- // of an EOAttribute (unfortunately, Oracle and EOF have opposite ideas of
- // what internal and external mean).
-
- typedef enum {
- OraVARCHAR2 = 1,
- OraNUMBER = 2,
- OraLONG = 8,
- OraROWID = 11,
- OraDATE = 12,
- OraRAW = 23,
- OraLONGRAW = 24,
- OraCHAR = 96,
- OraMLSLABEL = 106
- } OracleServerType;
-
- @interface OracleSQLExpression:EOSQLExpression
-
- //
- // The following set of methods are defined on EOSQLExpressionClass, the
- // parent class of OracleSQLExpressionClass.
- //
- + (int)serverTypeIdForName:(NSString *)typeName;
- // Returns the oracle type code (OraVARCHAR2, OraNumber, etc.) for a
- // given type name ("VARCHAR2", "NUMBER", etc.)
-
- + (BOOL)isValidQualifierType:(NSString *)typeName model:(EOModel *)model;
- // Methods called by the EO framework (through the adaptor) to generate
- // correct SQL.
-
- + (NSString *)formatValue:(id)value forAttribute:(EOAttribute *)attribute;
- // returns a formatted string representation of value that is suitable for use in a sql statement
-
- + (BOOL)useNoWaitLocks;
- + (void)setUseNoWaitLocks:(BOOL)yn;
- // These methods allow user to configure the lockClause of the OracleSQLExpression to
- // either be @"FOR UPDATE" (block until the row is available) or @"FOR UPDATE NOWAIT"
- // (return an error immediately if an attempt to lock a row would block).
- // By default the OracleSQLExpression will NOT use NOWAIT locks
- // This behavior is also controlable via the "EOOracleUseNoWaitLocks" user default
-
- - (NSString *)lockClause;
- // Queries the user default "EOOracleUseNoWaitLocks"
- // If this default is not set or is set to NO, lock clause returns @"FOR UPDATE"
- // If this default is set to YES, lock clause returns @"FOR UPDATE NOWAIT"
-
- - (NSString *)assembleSelectStatementWithAttributes:(NSArray *)attributes lock:(BOOL)lock qualifier:(EOQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder selectString:(NSString *)selectString columnList:(NSString *)columnList tableList:(NSString *)tableList whereClause:(NSString *)whereClause joinClause:(NSString *)joinClause orderByClause:(NSString *)orderByClause lockClause:(NSString *)lockClause;
-
- - (NSString *)assembleJoinClauseWithLeftName:(NSString *)leftName rightName:(NSString *)rightName joinSemantic:(EOJoinSemantic)semantic;
-
- // Overrides to use variable binding.
- - (NSMutableDictionary *)bindVariableDictionaryForAttribute:(EOAttribute *)attribute value:value;
- - (BOOL)shouldUseBindVariableForAttribute:(EOAttribute *)att;
- - (BOOL)mustUseBindVariableForAttribute:(EOAttribute *)att;
-
- //
- // End of methods inherited from the EOSQLExpression parent class
- //
-
- @end
-
-