home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / ORACLEAD.Z / OracleSQLExpression.h < prev   
Encoding:
Text File  |  1996-09-09  |  3.0 KB  |  73 lines

  1. // OracleSQLExpression.h
  2. // Copyright (c) 1994, NeXT Software, Inc.  All rights reserved.
  3.  
  4. #import <EOAccess/EOAccess.h>
  5.  
  6. @class OracleColumn;
  7.  
  8. // This class is used internally by the Oracle adaptor to generate Oracle
  9. // specific SQL.
  10.  
  11. // These are the codes for internal (in the server) Oracle data types.
  12. // OracleServerTypes are mapped by the adaptor to the "external type" string
  13. // of an EOAttribute (unfortunately, Oracle and EOF have opposite ideas of
  14. // what internal and external mean).
  15.  
  16. typedef enum {
  17.    OraVARCHAR2 =  1,
  18.    OraNUMBER   =  2,
  19.    OraLONG     =  8,
  20.    OraROWID    = 11,
  21.    OraDATE     = 12,
  22.    OraRAW      = 23,
  23.    OraLONGRAW  = 24,
  24.    OraCHAR     = 96,
  25.    OraMLSLABEL = 106
  26. } OracleServerType;
  27.  
  28. @interface OracleSQLExpression:EOSQLExpression
  29.  
  30. //
  31. // The following set of methods are defined on EOSQLExpressionClass, the
  32. // parent class of OracleSQLExpressionClass. 
  33. //
  34. + (int)serverTypeIdForName:(NSString *)typeName;
  35.     // Returns the oracle type code (OraVARCHAR2, OraNumber, etc.) for a
  36.     // given type name ("VARCHAR2", "NUMBER", etc.)
  37.  
  38. + (BOOL)isValidQualifierType:(NSString *)typeName model:(EOModel *)model;
  39.     // Methods called by the EO framework (through the adaptor) to generate
  40.     // correct SQL.
  41.  
  42. + (NSString *)formatValue:(id)value forAttribute:(EOAttribute *)attribute;
  43.     // returns a formatted string representation of value that is suitable for use in a sql statement
  44.  
  45. + (BOOL)useNoWaitLocks;
  46. + (void)setUseNoWaitLocks:(BOOL)yn;
  47.     // These methods allow user to configure the lockClause of the OracleSQLExpression to
  48.     // either be @"FOR UPDATE" (block until the row is available) or @"FOR UPDATE NOWAIT"
  49.     // (return an error immediately if an attempt to lock a row would block).
  50.     // By default the OracleSQLExpression will NOT use NOWAIT locks
  51.     // This behavior is also controlable via the "EOOracleUseNoWaitLocks" user default
  52.  
  53. - (NSString *)lockClause;
  54.     // Queries the user default "EOOracleUseNoWaitLocks"
  55.     // If this default is not set or is set to NO, lock clause returns @"FOR UPDATE"
  56.     // If this default is set to YES, lock clause returns @"FOR UPDATE NOWAIT"
  57.  
  58. - (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;
  59.  
  60. - (NSString *)assembleJoinClauseWithLeftName:(NSString *)leftName rightName:(NSString *)rightName joinSemantic:(EOJoinSemantic)semantic;
  61.  
  62. // Overrides to use variable binding.
  63. - (NSMutableDictionary *)bindVariableDictionaryForAttribute:(EOAttribute *)attribute value:value;
  64. - (BOOL)shouldUseBindVariableForAttribute:(EOAttribute *)att;
  65. - (BOOL)mustUseBindVariableForAttribute:(EOAttribute *)att;
  66.  
  67. //
  68. // End of methods inherited from the EOSQLExpression parent class
  69. //
  70.  
  71. @end
  72.  
  73.