OCILIB (C and C++ Driver for Oracle)  4.0.0
ocilib::Object Class Reference

Object identifying the SQL data type OBJECT. More...

#include <ocilib.hpp>

Inherits ocilib::HandleHolder< OCI_Object * >.

Public Types

enum  ObjectTypeValues { Persistent = OCI_OBJ_PERSISTENT, Transient = OCI_OBJ_TRANSIENT, Value = OCI_OBJ_VALUE }
 Object Type enumerated values. More...
 
typedef Enum< ObjectTypeValuesObjectType
 Object Type. More...
 

Public Member Functions

 Object (const TypeInfo &typeInfo)
 Parametrized constructor. More...
 
bool IsAttributeNull (const ostring &name) const
 Check if an object attribute is null. More...
 
void SetAttributeNull (const ostring &name)
 Set the given object attribute to null. More...
 
TypeInfo GetTypeInfo () const
 Return the TypeInfo object describing the object.
 
Reference GetReference () const
 Creates a reference on the current object.
 
ObjectType GetType () const
 Return the type of the given object.
 
template<class TDataType >
TDataType Get (const ostring &name) const
 Return the given object attribute value. More...
 
template<class TDataType >
void Set (const ostring &name, const TDataType &value)
 Set the given object attribute value. More...
 
Object Clone () const
 Clone the current instance to a new one performing deep copy.
 
ostring ToString () const
 return a string representation of the current object
 
 operator ostring () const
 Convenient operator returning a string representation of the current object. More...
 

Detailed Description

Object identifying the SQL data type OBJECT.

This class wraps the OCILIB object handle OCI_Object and its related methods

Definition at line 4159 of file ocilib.hpp.

Member Typedef Documentation

Object Type.

Possible values are Object::ObjectTypeValues

Definition at line 4193 of file ocilib.hpp.

Member Enumeration Documentation

Object Type enumerated values.

Enumerator
Persistent 

The object is persistent in the database

Transient 

The object is Transient

Value 

The object is a value member of another object

Definition at line 4176 of file ocilib.hpp.

Constructor & Destructor Documentation

ocilib::Object::Object ( const TypeInfo typeInfo)
inline

Parametrized constructor.

Parameters
typeInfo- type info descriptor

Definition at line 2653 of file ocilib_impl.hpp.

References ocilib::Check(), ocilib::TypeInfo::GetConnection(), OCI_ObjectCreate(), and OCI_ObjectFree().

Member Function Documentation

bool ocilib::Object::IsAttributeNull ( const ostring name) const
inline

Check if an object attribute is null.

Parameters
name- Attribute name

Definition at line 2673 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_ObjectIsNull().

void ocilib::Object::SetAttributeNull ( const ostring name)
inline

Set the given object attribute to null.

Parameters
name- Attribute name

Definition at line 2678 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_ObjectSetNull().

template<class TDataType >
TDataType ocilib::Object::Get ( const ostring name) const
inline

Return the given object attribute value.

Template Parameters
TDataType- C++ object type to retrieve
Parameters
name- Attribute name
Note
Specialized version of this template function are provided for all supported types

Definition at line 2827 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_ObjectGetColl().

template<class TDataType >
void ocilib::Object::Set ( const ostring name,
const TDataType &  value 
)
inline

Set the given object attribute value.

Template Parameters
TDataType- C++ object type to set
Parameters
name- Attribute name
value- Attribute value
Note
Specialized version of this template function are provided for all supported types

Definition at line 2947 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_ObjectSetColl().

ocilib::Object::operator ostring ( ) const
inline

Convenient operator returning a string representation of the current object.

Note
It calls ToString()

Definition at line 2965 of file ocilib_impl.hpp.