home *** CD-ROM | disk | FTP | other *** search
- // OracleAdaptor.h
- // Copyright (c) 1994, NeXT Software, Inc. All rights reserved.
-
- #import <EOAccess/EOAccess.h>
-
- @class OracleContext;
-
- // These keys define the standard connection information for an Oracle logon.
- //
- // If there is no value for the HostMachineKey then the a connection string
- // of the form "userName/password@serverId" is generated.
- //
- // If all the values except the one for serverId are absent, then the
- // connection string will just be the value for serverId.
-
- #define ServerIdKey @"serverId"
- #define HostMachineKey @"hostMachine"
- #define UserNameKey @"userName"
- #define PasswordKey @"password"
-
- // If this key is present in the connection dictionary, the other keys are
- // ignored and this string is passed returned from the -oracleConnectionString
- // method.
-
- #define ConnectionStringKey @"connectionString"
-
- // If this key is present, it will be used as the setting to NLS_LANG
- // used to specify the language and character set for server connections.
- // On J systems this option defaults to japanese_japan.jeuc
-
- #define NlsLangKey @"NLS_LANG"
-
- // Name of the UserDefaults domain for the Oracle Adaptor
- #define EOF_ORACLE_ADAPTOR @"EOFOracleAdaptor"
-
- @interface OracleAdaptor:EOAdaptor
- {
- unsigned short _connectedLogons;
- }
-
- // The following set of methods are defined on the EOAdaptor class
- // (the parent of OracleAdaptor) and are required by any subclass
- // EOAdaptor.
-
- - initWithName:(NSString *)name;
- // Designated initializer
- - (Class)defaultExpressionClass;
- // Returns the OracleSQLExpression class
- - (EOAdaptorContext *)createAdaptorContext;
- // Returns a new OracleContext, or nil if a new context cannot be
- // created. OracleAdaptors by default have no contexts at all. The newly
- // created context retains its adaptor.
- - (BOOL)isValidQualifierType:(NSString *)typeName model:(EOModel *)model;
- // Returns YES if an attribute of type typeName can be used in a
- // qualifier, otherwise returns NO.
- - (NSString *)oracleConnectionString;
- // This returns the user name, password, host machine, and server id as a
- // string suitable to be fed to orlon().
- - (void)assertConnectionDictionaryIsValid;
- // Raises an exception if any error occurs. An actual connection is made
- // when the first adaptor channel is sent an -openChannel message.
-
- // End of required methods from EOAdaptor
-
- - (Class)adaptorContextClass;
- // Returns the OracleContext class
-
- - (Class)adaptorChannelClass;
- // Returns the OracleContext class
-
- - (void)oracleContextWillConnect:(OracleContext *)logon;
- // This is called by an OracleContext when it will try to connect using
- // the adaptor's connection information.
-
- - (void)oracleContextDidDisconnect:(OracleContext *)logon;
- // This is called by an OracleContext which has just disconnected.
-
- - (NSArray *)connectionKeys;
- // A hook to allow programs to prompt the user for a connection dictionary.
-
- - (void)prepareEnvironmentForConnect;
- - (void)resetEnvironmentAfterConnect;
- // These should bracket all calls to orlon() to set
- // the NLS_LANG environment variable setting to the
- // value specified in the model connection dictionary.
-
- - (NSString *)fetchedValueForStringValue:(NSString *)value attribute:(EOAttribute *)attribute;
- // Provides default processing for string values. This method trims trailing spaces
- // and returns nil for 0 length strings;
-
- - (NSNumber *)fetchedValueForNumberValue:(NSNumber *)value attribute:(EOAttribute *)attribute;
- // Rounds the number according to precision and scale set on EOAttribute.
-
- - (NSCalendarDate *)fetchedValueForDateValue:(NSCalendarDate *)value attribute:(EOAttribute *)attribute;
- // Sets millisecond value to 0.
-
- - (NSData *)fetchedValueForDataValue:(NSData *)value attribute:(EOAttribute *)attribute;
- // Returns self.
-
- // The following two class methods are defined in EOAdaptor.h and must be
- // implemented by all subclasses.
- + (NSString *)internalTypeForExternalType:(NSString *)extType model:(EOModel *)model;
- + (NSArray *)externalTypesWithModel:(EOModel *)model;
-
- + (NSDictionary *)externalToInternalTypeMap;
- // This method returns a dictionary that maps each predefined externalType
- // known by the database to a default internal type.
- @end
-
-