OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
ocilib::Object Class Reference

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

#include <types.hpp>

Inheritance diagram for ocilib::Object:
ocilib::core::HandleHolder< OCI_Object * > ocilib::core::Streamable

Public Types

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

Public Member Functions

 Object ()
 Create an empty null Object instance.
 
 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 T >
Get (const ostring &name) const
 Return the given object attribute value. More...
 
template<class T >
void Get (const ostring &name, T &value) const
 Assign the given value with the given object attribute value. More...
 
template<class T >
void Get (const ostring &name, Collection< T > &value) const
 Assign the given collection with the given object attribute value of type collection. More...
 
template<class T >
void Set (const ostring &name, const T &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 override
 return a string representation of the current object
 

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 4667 of file types.hpp.

Member Typedef Documentation

◆ ObjectType

Object Type.

Possible values are Object::ObjectTypeValues

Definition at line 4701 of file types.hpp.

Member Enumeration Documentation

◆ ObjectTypeValues

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 4684 of file types.hpp.

Constructor & Destructor Documentation

◆ Object()

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

Parametrized constructor.

Parameters
typeInfo- type info descriptor

Definition at line 36 of file Object.hpp.

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

Member Function Documentation

◆ IsAttributeNull()

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

Check if an object attribute is null.

Parameters
name- Attribute name

Definition at line 60 of file Object.hpp.

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

◆ SetAttributeNull()

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

Set the given object attribute to null.

Parameters
name- Attribute name

Definition at line 65 of file Object.hpp.

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

◆ Get() [1/3]

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

Return the given object attribute value.

Template Parameters
T- 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 233 of file Object.hpp.

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

◆ Get() [2/3]

template<class T >
void ocilib::Object::Get ( const ostring name,
T &  value 
) const

Assign the given value with the given object attribute value.

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

◆ Get() [3/3]

template<class T >
void ocilib::Object::Get ( const ostring name,
Collection< T > &  value 
) const

Assign the given collection with the given object attribute value of type collection.

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

◆ Set()

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

Set the given object attribute value.

Template Parameters
T- 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 368 of file Object.hpp.

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