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.

Using Object References<br />

Nullness<br />

WHERE name=’BEAR BYTE DATA MANAGEMENT’<br />

This statement would return an embedded address object from the clients<br />

table. The application could then use the values in the attributes of this object for<br />

other processing. The application should execute the statement and fetch the object<br />

in the same way as described in the section "Overview of Associative Access" on<br />

page 3-13.<br />

If a column in a row of a database table has no value, then that column is said to be<br />

NULL, or to contain a NULL. Two different types of NULLs can apply to objects:<br />

■ Any attribute of an object can have a NULL value. This indicates that the value<br />

of that attribute of the object is not known.<br />

■ An object may be atomically NULL. This means that the value of the entire<br />

object is unknown.<br />

Atomic nullness is not the same thing as nonexistence. An atomically NULL object<br />

still exists, its value is just not known. It may be thought of as an existing object<br />

with no data.<br />

For every type of object attribute, OCCI provides a corresponding class. For<br />

instance, NUMBER attribute type maps to the Number class, REF maps to RefAny,<br />

and so on. Each and every OCCI class that represents a data type provides two<br />

methods:<br />

■ isNull — returns whether the object is null<br />

■ setNull — sets the object to null<br />

Similarly, these methods are inherited from the PObject class by all the objects and<br />

can be used to access and set atomically null information about them.<br />

Using Object References<br />

OCCI provides the application with the flexibility to access the contents of the<br />

objects using their pointers or their references. OCCI provides the<br />

PObject::getRef method to return a reference to a persistent object. This call is<br />

valid for persistent objects only.<br />

3-24 <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!