Skip Headers
Oracle® C++ Call Interface Programmer's Guide
10g Release 2 (10.2)

Part Number B14294-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

Map Class

The Map class is used to store the mapping of the SQL structured type to C++ classes.

For each user defined type, the Object Type Translator (OTT) generates a C++ class declaration and implements the static methods readSQL() and writeSQL(). The readSQL() method is called when the object from the server appears in the application as a C++ class instance. The writeSQL() method is called to marshal the object in the application cache to server data when it is being written / flushed to the server. The readSQL() and writeSQL() methods generated by OTT are based upon the OCCI standard C++ mappings.

If you want to override the standard OTT generated mappings with customized mappings, you must implement a custom C++ class along with the readSQL() and writeSQL() methods for each SQL structured type you need to customize. In addition, you must add an entry for each such class into the Map member of the Environment.


put()

Adds a map entry for the type, type_name, that you want to customize; you must implement the type_name C++ class.

You must then add this information into a map object, which should be registered with the connection if the user wants the standard mappings to overridden.This registration can be done by calling the this method after the environment is created passing the environment.

Syntax Description
void put(
   const string &schemaType,
   void *(*rSQL)(void *),
   void (*wSQL) (void *, void *));
Registers a type and its corresponding C++ readSQL and writeSQL functions.
void put(
   const string& schName,
   const string& typName,
   void *(*rSQL)(void *),
   void (*wSQL)(void *, void *));
Registers a type and its corresponding C++ readSQL and writeSQL functions; multibyte support.
void put(
   const UString& schName,
   const UString& typName,
   void *(*rSQL)(void *),
   void (*wSQL)(void *, void *));
Registers a type and its corresponding C++ readSQL and writeSQL functions; unicode support.

Parameter Description
schemaType
The schema and typename, separated by ".", like SCOTT.TYPE1
schName
Name of the scema
typName
Name of the type
rDQL
The readSQL function ponter of the C++ class that corresponds to the type
wSQL
The writeSQL function ponter of the C++ class that corresponds to the typ