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

  1. // OracleAdaptor.h
  2. // Copyright (c) 1994, NeXT Software, Inc.  All rights reserved.
  3.  
  4. #import <EOAccess/EOAccess.h>
  5.  
  6. @class OracleContext;
  7.  
  8. // These keys define the standard connection information for an Oracle logon.
  9. //
  10. // If there is no value for the HostMachineKey then the a connection string
  11. // of the form "userName/password@serverId" is generated.
  12. //
  13. // If all the values except the one for serverId are absent, then the
  14. // connection string will just be the value for serverId.
  15.  
  16. #define ServerIdKey @"serverId"
  17. #define HostMachineKey @"hostMachine"
  18. #define UserNameKey @"userName"
  19. #define PasswordKey @"password"
  20.  
  21. // If this key is present in the connection dictionary, the other keys are
  22. // ignored and this string is passed returned from the -oracleConnectionString
  23. // method.
  24.  
  25. #define ConnectionStringKey @"connectionString"
  26.  
  27. // If this key is present, it will be used as the setting to NLS_LANG
  28. // used to specify the language and character set for server connections.
  29. // On J systems this option defaults to japanese_japan.jeuc
  30.  
  31. #define NlsLangKey @"NLS_LANG"
  32.  
  33. // Name of the UserDefaults domain for the Oracle Adaptor
  34. #define EOF_ORACLE_ADAPTOR @"EOFOracleAdaptor"
  35.  
  36. @interface OracleAdaptor:EOAdaptor
  37. {
  38.     unsigned short _connectedLogons;
  39. }
  40.  
  41. // The following set of methods are defined on the EOAdaptor class
  42. // (the parent of OracleAdaptor) and are required by any subclass
  43. // EOAdaptor.
  44.  
  45. - initWithName:(NSString *)name;
  46.     // Designated initializer
  47. - (Class)defaultExpressionClass;
  48.     // Returns the OracleSQLExpression class
  49. - (EOAdaptorContext *)createAdaptorContext;
  50.     // Returns a new OracleContext, or nil if a new context cannot be
  51.     // created.  OracleAdaptors by default have no contexts at all.  The newly
  52.     // created context retains its adaptor.
  53. - (BOOL)isValidQualifierType:(NSString *)typeName model:(EOModel *)model;
  54.     // Returns YES if an attribute of type typeName can be used in a
  55.     // qualifier, otherwise returns NO.
  56. - (NSString *)oracleConnectionString;
  57.     // This returns the user name, password, host machine, and server id as a
  58.     // string suitable to be fed to orlon().
  59. - (void)assertConnectionDictionaryIsValid;
  60.     // Raises an exception if any error occurs. An actual connection is made
  61.     // when the first adaptor channel is sent an -openChannel message.
  62.  
  63. // End of required methods from EOAdaptor
  64.  
  65. - (Class)adaptorContextClass;
  66.     // Returns the OracleContext class
  67.  
  68. - (Class)adaptorChannelClass;
  69.     // Returns the OracleContext class
  70.  
  71. - (void)oracleContextWillConnect:(OracleContext *)logon;
  72.     // This is called by an OracleContext when it will try to connect using
  73.     // the adaptor's connection information.
  74.  
  75. - (void)oracleContextDidDisconnect:(OracleContext *)logon;
  76.     // This is called by an OracleContext which has just disconnected.
  77.  
  78. - (NSArray *)connectionKeys;
  79.     // A hook to allow programs to prompt the user for a connection dictionary.
  80.  
  81. - (void)prepareEnvironmentForConnect;
  82. - (void)resetEnvironmentAfterConnect;
  83.     // These should bracket all calls to orlon() to set
  84.     // the NLS_LANG environment variable setting to the
  85.     // value specified in the model connection dictionary.
  86.  
  87. - (NSString *)fetchedValueForStringValue:(NSString *)value attribute:(EOAttribute *)attribute;
  88.     // Provides default processing for string values. This method trims trailing spaces
  89.     // and returns nil for 0 length strings;
  90.  
  91. - (NSNumber *)fetchedValueForNumberValue:(NSNumber *)value attribute:(EOAttribute *)attribute;
  92.     // Rounds the number according to precision and scale set on EOAttribute.
  93.  
  94. - (NSCalendarDate *)fetchedValueForDateValue:(NSCalendarDate *)value attribute:(EOAttribute *)attribute;
  95.     // Sets millisecond value to 0.
  96.  
  97. - (NSData *)fetchedValueForDataValue:(NSData *)value attribute:(EOAttribute *)attribute;
  98.     // Returns self.
  99.  
  100. // The following two class methods are defined in EOAdaptor.h and must be
  101. // implemented by all subclasses.
  102. + (NSString *)internalTypeForExternalType:(NSString *)extType model:(EOModel *)model;
  103. + (NSArray *)externalTypesWithModel:(EOModel *)model;
  104.  
  105. + (NSDictionary *)externalToInternalTypeMap;
  106.     // This method returns a dictionary that maps each predefined externalType
  107.     // known by the database to a default internal type.
  108. @end
  109.  
  110.