KexiDB::IndexSchema Class Reference
#include <indexschema.h>
Inheritance diagram for KexiDB::IndexSchema:

Detailed Description
Provides information about database index that can be created for a database table.IndexSchema object stores information about table fields that defines this index and additional properties like: whether index is unique or primary key (requires unique). Single-field index can be also auto generated.
Definition at line 43 of file indexschema.h.
Member Typedef Documentation
|
|
Definition at line 46 of file indexschema.h. |
|
|
Definition at line 47 of file indexschema.h. |
Constructor & Destructor Documentation
|
|
Constructs empty index schema object that is assigned to table, and will be owned by this table. Any fields added with addField() won't be owned by index, but by its table. Do not forget to add these fields to table, because adding these to IndexSchema is not enough. Definition at line 32 of file indexschema.cpp. References m_master_owned_rels. |
|
||||||||||||
|
Copy constructor. Copies all attributes from index idx, and fields assigned with it but the fields are taken (by name) from parentTable, not from idx itself, so it's possible to copy of index for a copy of table. To copy an index within the same table it's enough to call: new IndexSchema(idx, *idx.table());
Definition at line 44 of file indexschema.cpp. References addField(), KexiDB::FieldList::clear(), KexiDB::FieldList::field(), KexiDBWarn, and m_master_owned_rels. |
|
|
Destroys the index. Field objects are not deleted. All Relationship objects listed in masterRelationships() list are destroyed (these are also detached from detail-side indices before destruction). Relationship objects listed in detailsRelationships() are not touched. Definition at line 75 of file indexschema.cpp. References m_master_owned_rels. |
Member Function Documentation
|
|
Adds field at the end of field list. Field will not be owned by index. Field must belong to a table the index is bulit on, otherwise field couldn't be added. Definition at line 91 of file indexschema.cpp. References KexiDB::FieldList::addField(), KexiDBDbg, m_tableSchema, KexiDB::Field::name(), and KexiDB::Field::table(). Referenced by KexiDB::Relationship::createIndices(), IndexSchema(), and KexiDB::TableSchema::insertField(). |
|
||||||||||||
|
Internal version of attachRelationship(). If ownedByMaster is true, attached rel object will be owned by this index. Definition at line 169 of file indexschema.cpp. References KexiDB::Relationship::detailsIndex(), m_details_rels, m_master_owned_rels, m_master_rels, and KexiDB::Relationship::masterIndex(). |
|
|
Attaches relationship definition rel to this IndexSchema object. If rel relationship has this IndexSchema defined at the master-side, rel is added to the list of master relationships (available with masterRelationships()). If rel relationship has this IndexSchema defined at the details-side, rel is added to the list of details relationships (available with detailsRelationships()). For the former case, attached rel object is now owned by this IndexSchema object. Note: call detachRelationship() for IndexSchema object that rel was previously attached to, if any. Definition at line 164 of file indexschema.cpp. Referenced by KexiDB::Relationship::setIndices(). |
|
|
Reimplemented from KexiDB::FieldList. Definition at line 154 of file indexschema.cpp. References KexiDB::FieldList::debugString(), m_isAutoGenerated, m_isForeignKey, m_primary, m_unique, and KexiDB::SchemaData::schemaDataDebugString(). |
|
|
Detaches relationship definition rel for this IndexSchema object from the list of master relationships (available with masterRelationships()), or from details relationships list, depending for which side of the relationship is this IndexSchem object assigned. Note: If rel was detached from masterRelationships() list, this object now has no parent, so you need to attach it to somewhere or destruct it. Definition at line 192 of file indexschema.cpp. References m_details_rels, m_master_owned_rels, and m_master_rels. |
|
|
Definition at line 94 of file indexschema.h. Referenced by KexiCellEditorFactory::createEditor(). |
|
|
This flag is handled internally by TableSchema. It can be usable for GUI application if we do not want display implicity/auto generated indices on the indices list or we if want to show these indices to the user in a special way. Definition at line 109 of file indexschema.cpp. References m_isAutoGenerated. |
|
|
Definition at line 119 of file indexschema.cpp. References m_primary. |
|
|
Definition at line 131 of file indexschema.cpp. References m_unique. |
|
|
Definition at line 89 of file indexschema.h. |
|
|
Sets auto-generated flag. This method should be called only from TableSchema code
Definition at line 114 of file indexschema.cpp. References m_isAutoGenerated. Referenced by KexiDB::TableSchema::insertField(). |
|
|
If set is true, declares that the index defines a foreign key, created implicity for Relationship object. Setting this to true, implies clearing 'primary key', 'unique' and 'auto generated' flags. If this index contains just single field, it's 'foreign field' flag will be set to true as well. Definition at line 143 of file indexschema.cpp. References KexiDB::FieldList::fieldCount(), KexiDB::FieldList::m_fields, m_isForeignKey, and setUnique(). Referenced by KexiDB::Relationship::createIndices(). |
|
|
Sets PRIMARY KEY flag. Definition at line 124 of file indexschema.cpp. References m_primary, and m_unique. Referenced by KexiDB::TableSchema::setPrimaryKey(). |
|
|
Sets UNIQUE flag.
Definition at line 136 of file indexschema.cpp. References m_primary, and m_unique. Referenced by KexiDB::TableSchema::insertField(), and setForeignKey(). |
|
|
Definition at line 104 of file indexschema.cpp. References m_tableSchema. Referenced by KexiDB::Relationship::createIndices(), KexiDB::Relationship::detailsTable(), KexiDB::Relationship::masterTable(), and KexiDB::Relationship::setIndices(). |
Friends And Related Function Documentation
|
|
Reimplemented from KexiDB::SchemaData. Definition at line 201 of file indexschema.h. |
|
|
Definition at line 203 of file indexschema.h. |
|
|
Definition at line 204 of file indexschema.h. |
|
|
Definition at line 202 of file indexschema.h. |
Member Data Documentation
|
|
a list of relationships to table (of this index) Definition at line 194 of file indexschema.h. Referenced by attachRelationship(), and detachRelationship(). |
|
|
Definition at line 198 of file indexschema.h. Referenced by debugString(), isAutoGenerated(), and setAutoGenerated(). |
|
|
Definition at line 199 of file indexschema.h. Referenced by debugString(), and setForeignKey(). |
|
|
table on that index is built a list of master relationships for the table (of this index), this index is a master key for these relationships and therefore - owner of these Definition at line 188 of file indexschema.h. Referenced by attachRelationship(), detachRelationship(), IndexSchema(), and ~IndexSchema(). |
|
|
a list of master relationships that are not owned by this schema Definition at line 191 of file indexschema.h. Referenced by attachRelationship(), and detachRelationship(). |
|
|
Definition at line 196 of file indexschema.h. Referenced by debugString(), isPrimaryKey(), setPrimaryKey(), and setUnique(). |
|
|
Definition at line 182 of file indexschema.h. Referenced by addField(), and table(). |
|
|
Definition at line 197 of file indexschema.h. Referenced by debugString(), isUnique(), setPrimaryKey(), and setUnique(). |
The documentation for this class was generated from the following files:
