1111
1212namespace impeller {
1313
14- static const char * const ArchiveColumnPrefix = " item" ;
15- static const char * const ArchivePrimaryKeyColumnName = " name" ;
16- static const char * const ArchiveTablePrefix = " RL_" ;
14+ static const char * const ArchiveColumnPrefix = " col_" ;
15+ static const char * const ArchivePrimaryKeyColumnName = " primary_key" ;
1716
1817ArchiveClassRegistration::ArchiveClassRegistration (ArchiveDatabase& database,
1918 ArchiveDef definition)
20- : database_(database), class_name_(definition.className ) {
19+ : database_(database), class_name_(definition.table_name ) {
2120 /*
2221 * Each class in the archive class hierarchy is assigned an entry in the
2322 * class map.
@@ -31,11 +30,11 @@ ArchiveClassRegistration::ArchiveClassRegistration(ArchiveDatabase& database,
3130 for (const auto & member : current->members ) {
3231 map[member] = currentMember++;
3332 }
34- class_map_[current->className ] = map;
35- current = current->superClass ;
33+ class_map_[current->table_name ] = map;
34+ current = current->isa ;
3635 }
3736
38- is_ready_ = CreateTable (definition.autoAssignName );
37+ is_ready_ = CreateTable (definition.auto_key );
3938}
4039
4140const std::string& ArchiveClassRegistration::GetClassName () const {
@@ -81,8 +80,8 @@ bool ArchiveClassRegistration::CreateTable(bool autoIncrement) {
8180 * Table names cannot participate in parameter substitution, so we prepare
8281 * a statement and check its validity before running.
8382 */
84- stream << " CREATE TABLE IF NOT EXISTS " << ArchiveTablePrefix
85- << class_name_. c_str () << " ( " << ArchivePrimaryKeyColumnName;
83+ stream << " CREATE TABLE IF NOT EXISTS " << class_name_. c_str () << " ( "
84+ << ArchivePrimaryKeyColumnName;
8685
8786 if (autoIncrement) {
8887 stream << " INTEGER PRIMARY KEY AUTOINCREMENT, " ;
@@ -120,7 +119,7 @@ ArchiveStatement ArchiveClassRegistration::GetQueryStatement(
120119 stream << " ," ;
121120 }
122121 }
123- stream << " FROM " << ArchiveTablePrefix << class_name_;
122+ stream << " FROM " << class_name_;
124123
125124 if (single) {
126125 stream << " WHERE " << ArchivePrimaryKeyColumnName << " = ?" ;
@@ -135,8 +134,7 @@ ArchiveStatement ArchiveClassRegistration::GetQueryStatement(
135134
136135ArchiveStatement ArchiveClassRegistration::GetInsertStatement () const {
137136 std::stringstream stream;
138- stream << " INSERT OR REPLACE INTO " << ArchiveTablePrefix << class_name_
139- << " VALUES ( ?, " ;
137+ stream << " INSERT OR REPLACE INTO " << class_name_ << " VALUES ( ?, " ;
140138 for (size_t i = 0 ; i < member_count_; i++) {
141139 stream << " ?" ;
142140 if (i != member_count_ - 1 ) {
0 commit comments