Public Member Functions | |
bool | build (DataElement &dataElement) |
OraPtrReadBuffer (const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema) | |
void * | read (const std::vector< int > &fullId) |
~OraPtrReadBuffer () | |
Private Attributes | |
DataElement * | m_dataElement |
DataElement | m_localElement |
MappingElement & | m_mapping |
Reflex::Type | m_objectType |
SelectOperation | m_query |
std::auto_ptr< IRelationalReader > | m_reader |
ContainerSchema & | m_schema |
Definition at line 16 of file OraPtrStreamer.cc.
ora::OraPtrReadBuffer::OraPtrReadBuffer | ( | const Reflex::Type & | objectType, |
MappingElement & | mapping, | ||
ContainerSchema & | contSchema | ||
) | [inline] |
Definition at line 18 of file OraPtrStreamer.cc.
{ }
ora::OraPtrReadBuffer::~OraPtrReadBuffer | ( | ) | [inline] |
Definition at line 28 of file OraPtrStreamer.cc.
{
bool ora::OraPtrReadBuffer::build | ( | DataElement & | dataElement | ) | [inline] |
Definition at line 31 of file OraPtrStreamer.cc.
References ora::SelectOperation::addWhereId(), i, and m_query.
{ m_query.addWhereId( columns[ i ] ); } // Check the type Reflex::Type ptrType = m_objectType.TemplateArgumentAt(0); Reflex::Type ptrResolvedType = ClassUtils::resolvedType(ptrType); // Check the component type if ( ! ptrType || !ptrResolvedType ) { throwException( "Missing dictionary information for the type of the pointer \"" + m_objectType.Name(Reflex::SCOPED|Reflex::FINAL) + "\"", "OraPtrReadBuffer::build" ); } std::string ptrTypeName = ptrType.Name(); // Retrieve the relevant mapping element MappingElement::iterator iMe = m_mapping.find( ptrTypeName ); if ( iMe == m_mapping.end() ) { throwException( "Item for \"" + ptrTypeName + "\" not found in the mapping element", "OraPtrReadBuffer::build" ); } RelationalStreamerFactory streamerFactory( m_schema ); m_reader.reset( streamerFactory.newReader( ptrResolvedType, iMe->second ) ); return m_reader->build( m_localElement, m_query ); }
void* ora::OraPtrReadBuffer::read | ( | const std::vector< int > & | fullId | ) | [inline] |
Definition at line 63 of file OraPtrStreamer.cc.
{ if( i<fullId.size() ){ iCol->data<int>() = fullId[i]; } i++; } std::vector<int> recordId( fullId.size()-1 ); for( size_t i=0; i<fullId.size()-1; i++ ){ recordId[i] = fullId[i+1]; ++i; } m_query.execute(); m_reader->select( fullId[0] ); void* destination = 0; if( m_query.nextCursorRow() ){ destination = ClassUtils::constructObject( m_objectType.TemplateArgumentAt(0) ); m_reader->setRecordId( recordId ); m_reader->read( destination ); } m_query.clear(); return destination; }
DataElement* ora::OraPtrReadBuffer::m_dataElement [private] |
Definition at line 102 of file OraPtrStreamer.cc.
Definition at line 100 of file OraPtrStreamer.cc.
MappingElement& ora::OraPtrReadBuffer::m_mapping [private] |
Definition at line 98 of file OraPtrStreamer.cc.
Reflex::Type ora::OraPtrReadBuffer::m_objectType [private] |
Definition at line 97 of file OraPtrStreamer.cc.
Definition at line 101 of file OraPtrStreamer.cc.
Referenced by build().
std::auto_ptr<IRelationalReader> ora::OraPtrReadBuffer::m_reader [private] |
Definition at line 103 of file OraPtrStreamer.cc.
ContainerSchema& ora::OraPtrReadBuffer::m_schema [private] |
Definition at line 99 of file OraPtrStreamer.cc.