10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Map Class<br />

Map Class<br />

The Map class is used to store the mapping of the SQL structured type to <strong>C++</strong><br />

classes.<br />

For each user defined type, the Object Type Translator (OTT) generates a <strong>C++</strong> class<br />

declaration and implements the static methods readSQL() and writeSQL(). The<br />

readSQL() method is called when the object from the server appears in the<br />

application as a <strong>C++</strong> class instance. The writeSQL() method is called to marshal<br />

the object in the application cache to server data when it is being written / flushed<br />

to the server. The readSQL() and writeSQL() methods generated by OTT are<br />

based upon the OCCI standard <strong>C++</strong> mappings.<br />

If you want to override the standard OTT generated mappings with customized<br />

mappings, you must implement a custom <strong>C++</strong> class along with the readSQL() and<br />

writeSQL() methods for each SQL structured type you need to customize. In<br />

addition, you must add an entry for each such class into the Map member of the<br />

Environment.<br />

To..., use the syntax:<br />

Map();<br />

Summary of Map Methods<br />

put()<br />

Table 8–12 Map Methods<br />

Method Summary<br />

put() on page 8-92 Adds a map entry for the type to be customized.<br />

This method adds a map entry for the type to be customized.<br />

This method adds a map entry for the type, type_name, that you want to customize.<br />

You must implement the type_name <strong>C++</strong> class along with its static methods,<br />

readSQL() and writeSQL().<br />

You must then add this information into a map object, which should be registered<br />

with the connection if the user wants the standard mappings to overridden.This<br />

8-92 <strong>Oracle</strong> <strong>C++</strong> <strong>Call</strong> <strong>Interface</strong> Programmer’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!