6 namespace persistency {
8 GLOBAL_TAG::Table::Table( coral::ISchema&
schema ):
12 bool GLOBAL_TAG::Table::exists(){
13 return existsTable( m_schema, tname );
17 Query< NAME >
q( m_schema );
18 q.addCondition<NAME>(
name );
19 for (
auto row :
q ) {}
21 return q.retrievedRows();
26 boost::posix_time::ptime& snapshotTime ){
32 Query< VALIDITY >
q( m_schema );
33 q.addCondition<NAME>(
name );
34 for (
auto row : q ) std::tie( validity ) = row;
36 return q.retrievedRows();
43 boost::posix_time::ptime& snapshotTime ){
49 Query< VALIDITY, DESCRIPTION, RELEASE >
q( m_schema );
50 q.addCondition<NAME>(
name );
51 for (
auto row : q ) std::tie( validity, description, release ) = row;
52 return q.retrievedRows();
59 const boost::posix_time::ptime& snapshotTime,
60 const boost::posix_time::ptime& insertionTime ){
61 RowBuffer< NAME, VALIDITY, DESCRIPTION, RELEASE, SNAPSHOT_TIME, INSERTION_TIME >
62 dataToInsert( std::tie( name, validity, description, release, snapshotTime, insertionTime ) );
63 insertInTable( m_schema, tname, dataToInsert.get() );
70 const boost::posix_time::ptime& snapshotTime,
71 const boost::posix_time::ptime& insertionTime ){
73 buffer.setColumnData< VALIDITY, DESCRIPTION,
RELEASE, SNAPSHOT_TIME, INSERTION_TIME >( std::tie( validity, description, release, snapshotTime, insertionTime ) );
74 buffer.addWhereCondition<NAME>(
name );
75 updateTable( m_schema, tname, buffer );
78 GLOBAL_TAG_MAP::Table::Table( coral::ISchema&
schema ):
82 bool GLOBAL_TAG_MAP::Table::exists(){
83 return existsTable( m_schema, tname );
87 std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
88 Query< RECORD, LABEL, TAG_NAME >
q( m_schema );
89 q.addCondition< GLOBAL_TAG_NAME >( gtName );
90 q.addOrderClause<RECORD>();
91 q.addOrderClause<
LABEL>();
92 for (
auto row : q ) {
93 if ( std::get<1>(row) ==
"-" ) {
94 std::get<1>(row) =
"";
96 tags.push_back( row );
98 return q.retrievedRows();
102 std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
107 const std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
108 BulkInserter<GLOBAL_TAG_NAME, RECORD, LABEL, TAG_NAME > inserter( m_schema, tname );
109 for(
auto row :
tags ) inserter.insert( std::tuple_cat( std::tie( gtName ),row ) );
115 m_gtMapTable( schema ){
GLOBAL_TAG::Table & gtTable()
GLOBAL_TAG::Table m_gtTable
GTSchema(coral::ISchema &schema)
unsigned long long Time_t
GLOBAL_TAG_MAP::Table & gtMapTable()
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
GLOBAL_TAG_MAP::Table m_gtMapTable