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.

PObject Class<br />

PObject Class<br />

OCCI provides object navigational calls that enable applications to perform any of<br />

the following on objects:<br />

■ Creating, accessing, locking, deleting, copying, and flushing objects<br />

■ Getting references to the objects<br />

This class enables the type definer to specify when a class is capable of having<br />

persistent or transient instances. Instances of classes derived from PObject are<br />

either persistent or transient. A class (called "A") that is persistent-capable inherits<br />

from the PObject class:<br />

class A : PObject { ... }<br />

Some of the methods provided, such as lock() and refresh(), are applicable<br />

only for persistent instances, not for transient instances.<br />

To create a null PObject, use the syntax:<br />

PObject();<br />

The only methods valid on a null PObject are setNull(), isNull, and<br />

operator=().<br />

To create a copy of a PObject, use the syntax:<br />

PObject(const PObject& obj);<br />

Summary of PObject Methods<br />

Table 8–15 PObject Methods<br />

Method Summary<br />

flush() on page 8-127 Flushes a modified persistent object to the database<br />

server.<br />

getConnection() on page 8-127 Return the connection from which the PObject object<br />

was instantiated.<br />

getRef() on page 8-127 Return a reference to a given persistent object.<br />

isLocked() on page 8-128 Test whether the persistent object is locked.<br />

isNull() on page 8-128 Test whether the object is null.<br />

8-126 <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!