home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEPLOY / ODBCAD.Z / ODBCSQLExpression.h < prev   
Text File  |  1996-09-09  |  3KB  |  79 lines

  1. /*
  2.    ODBCSQLExpression.h
  3.    Copyright (c) 1996, NeXT Software, Inc.
  4.    All rights reserved.
  5. */
  6.  
  7. #import <EOAccess/EOAccess.h>
  8.    
  9. @interface ODBCSQLExpression : EOSQLExpression
  10. {
  11.     unsigned _inSelect:1;
  12.     unsigned _sybaseLocking:1;
  13. }
  14.  
  15. - (NSString *)lockClause;
  16.     // Returns a the SQL string which will cause the RDBMS to place a
  17.     // pessimistic lock on any rows fetched.
  18.  
  19. - (NSString *)tableListWithRootEntity:(EOEntity *)entity;
  20.     // Returns a list of aliased table names that can be used as the "FROM"
  21.     // part of a SQL expression
  22.  
  23. - (void)prepareSelectExpressionWithAttributes:(NSArray *)attributes lock:(BOOL)lock fetchSpecification:(EOFetchSpecification *)fetchSpec;
  24.     // Invokes the following methods
  25.     //  [self addSelectListAttribute:] for each att in attributes
  26.     //    [qualifier sqlStringForSQLExpression:self]
  27.     //    [self addOrderByAttributeOrdering:] for each attributeOrdering in fetchOrders
  28.     //    [self joinExpression]
  29.     //    [self tableListWithRootEntity:_entity]
  30.     //    [self lockClause]
  31.     //    [self assembleSelectStatementWithSelectString: ...]
  32.  
  33. - (void)addJoinClauseWithLeftName:(NSString *)leftName rightName:(NSString *)rightName joinSemantic:(EOJoinSemantic)semantic;
  34.     // Calls assembleJoinClauseWithLeftName ... and then appends the resulting
  35.     // string to the joinClause string
  36.  
  37. + (BOOL)useBindVariables;
  38.     // Returns YES if the application is currently using bind variables, NO
  39.     // otherwise. ODBC is always returnning YES.
  40.  
  41. - (NSMutableDictionary *)bindVariableDictionaryForAttribute:(EOAttribute *)att value:value;
  42.     // Returns a dictionary to be stored in the EOSQLExpression that contains
  43.     // whatever adaptor specific information is necessary to bind the values.
  44.     // This following keys must have values in the binding dictionary because
  45.     // their values are used by the superclasss: EOBindVariableNameKey,
  46.     // EOBindVariableValueKey, EOBindVariablePlaceHolderKey, and
  47.     // EOBindVariableAttributeKey.
  48.  
  49. - (BOOL)shouldUseBindVariableForAttribute:(EOAttribute *)att;
  50.     // Returns YES if the the adaptor provides bind variable capability for
  51.     // attributes of this type. ODBC always return YES.
  52.  
  53. - (BOOL)mustUseBindVariableForAttribute:(EOAttribute *)att;
  54.     // Returns YES if the the adaptor must use bind variable capability for
  55.     // attributes of this type. ODBC always return YES.
  56.  
  57. @end
  58.  
  59. @interface ODBCSQLExpression(EOSchemaGeneration)
  60.  
  61. + (NSArray *)primaryKeySupportStatementsForEntityGroup:(NSArray *)entityGroup;
  62. + (NSArray *)dropPrimaryKeySupportStatementsForEntityGroup:(NSArray *)entityGroup;
  63.     // returns empty arrays. It's a non supported feature for ODBC.
  64.  
  65. + (NSArray *)primaryKeyConstraintStatementsForEntityGroup:(NSArray *)entityGroup;
  66.     // returns empty arrays. It's a non supported feature for ODBC.
  67.     // The primary key is encoded in the CREATE statement
  68.  
  69. - (NSString *)columnTypeStringForAttribute:(EOAttribute *)attribute;
  70.     // Assembles an adaptor specific type string suitable for use in a create
  71.     // table statement.
  72.  
  73. - (NSString *)allowsNullClauseForConstraint:(BOOL)allowsNull;
  74.     // Generates an adaptor specific string for use in a create table statement
  75.     // that indicates whether this column allows null.
  76.  
  77. @end
  78.  
  79.