#include <PoolDatabaseSchema.h>
Definition at line 65 of file PoolDatabaseSchema.h.
ora::PoolSequenceTable::PoolSequenceTable |
( |
coral::ISchema & |
dbSchema | ) |
|
|
explicit |
ora::PoolSequenceTable::~PoolSequenceTable |
( |
| ) |
|
|
virtual |
bool ora::PoolSequenceTable::add |
( |
const std::string & |
sequenceName | ) |
|
|
virtual |
Implements ora::ISequenceTable.
Definition at line 86 of file PoolDatabaseSchema.cc.
88 coral::AttributeList insertData;
91 coral::AttributeList::iterator iAttribute = insertData.begin();
92 iAttribute->data< std::string >() = sequenceName;
94 iAttribute->data<
int >() = 0;
static std::string tableName()
static std::string sequenceNameColumn()
static std::string sequenceValueColumn()
coral::ISchema & m_schema
void ora::PoolSequenceTable::create |
( |
| ) |
|
|
virtual |
void ora::PoolSequenceTable::drop |
( |
| ) |
|
|
virtual |
void ora::PoolSequenceTable::erase |
( |
const std::string & |
sequenceName | ) |
|
|
virtual |
Implements ora::ISequenceTable.
Definition at line 160 of file PoolDatabaseSchema.cc.
161 coral::AttributeList whereData;
165 m_schema.tableHandle(
tableName() ).dataEditor().deleteRows( whereClause, whereData );
static std::string tableName()
static std::string sequenceNameColumn()
coral::ISchema & m_schema
bool ora::PoolSequenceTable::exists |
( |
| ) |
|
|
virtual |
bool ora::PoolSequenceTable::getLastId |
( |
const std::string & |
sequenceName, |
|
|
int & |
lastId |
|
) |
| |
|
virtual |
Implements ora::ISequenceTable.
Definition at line 100 of file PoolDatabaseSchema.cc.
References o2o::query, and ora::throwException().
103 throwException(
"Sequence Table handle has not been initialized.",
"PoolSequenceTable::getLastId");
108 std::map<std::string,PoolDbCacheData*>::iterator iS = seq.find( sequenceName );
109 if( iS != seq.end()){
110 if( iS->second->m_nobjWr == 0 )
return false;
111 lastId = iS->second->m_nobjWr-1;
117 query->limitReturnedRows( 1, 0 );
120 query->setForUpdate();
122 coral::AttributeList rowData;
124 rowData.begin()->data< std::string >() = sequenceName;
125 query->setCondition( whereClause, rowData );
126 coral::ICursor& cursor =
query->execute();
127 if ( cursor.next() ) {
128 lastId = cursor.currentRow().begin()->data<
int >();
static std::string tableName()
std::map< std::string, PoolDbCacheData * > & sequences()
static std::string sequenceNameColumn()
static std::string sequenceValueColumn()
void throwException(const std::string &message, const std::string &methodName)
coral::ISchema & m_schema
void ora::PoolSequenceTable::init |
( |
PoolDbCache & |
dbCache | ) |
|
std::string ora::PoolSequenceTable::sequenceNameColumn |
( |
| ) |
|
|
static |
std::string ora::PoolSequenceTable::sequenceValueColumn |
( |
| ) |
|
|
static |
void ora::PoolSequenceTable::sinchronize |
( |
const std::string & |
sequenceName, |
|
|
int |
lastValue |
|
) |
| |
|
virtual |
Implements ora::ISequenceTable.
Definition at line 134 of file PoolDatabaseSchema.cc.
References ora::throwException().
137 throwException(
"Sequence Table handle has not been initialized.",
"PoolSequenceTable::sinchronize");
141 std::map<std::string,PoolDbCacheData*>::iterator iS = seq.find( sequenceName );
142 if( iS != seq.end()){
147 coral::AttributeList updateData;
153 coral::AttributeList::iterator iAttribute = updateData.begin();
154 iAttribute->data< std::string >() = sequenceName;
157 m_schema.tableHandle(
tableName() ).dataEditor().updateRows( setClause,whereClause,updateData );
static std::string tableName()
std::map< std::string, PoolDbCacheData * > & sequences()
static std::string sequenceNameColumn()
static std::string sequenceValueColumn()
void throwException(const std::string &message, const std::string &methodName)
coral::ISchema & m_schema
std::string ora::PoolSequenceTable::tableName |
( |
| ) |
|
|
static |
coral::ISchema& ora::PoolSequenceTable::m_schema |
|
private |