#include <iopcClassObjectImpl.h>
Inheritance diagram for IopcClassObjectImpl:
For each class that is IopcPersistentObject ancestor there is one instance of IopcClassObjectImpl that represents it. The instance contains all the information about the persistent class - for example names and types of its attributes, list of class parents, information about class mapping and so on. These informations are set when creating the IopcClassObjectImpl object - in IopcClassObjectContainer::initializeUsingMetadataLoader().
Main purpose of this object is to provide functions for persistent objects' data manipulation. It contains functions that load attributes of persistent object from the database, update the object in database, delete it or insert a new persistent object into the database. Some other functions support executing queries on the persistent objects.
Persistent class attributes (attributes) are lexicographically ordered in this class - see AttrVector. This is needed because of performance reasons - when transferring data between persistent object and the database (importExportArray is used). See IopcImportExportStruct, IopcPersistentObject::iopcImportAttributes(), and IopcPersistentObject::iopcExportAttributes() for further info.
When loading persistent object's data from the database, class's simple view is used (simpleViewName). Simple view contains all instances of the represented class but not instances of its descendants. Class's polymorphic view (polymorphicViewName) contains all instances of a persistent class including instances of class's descendants. It is used when querying persistent objects.
Public methods of this class are called from IopcPersistentObject ancestors through interface IopcClassObject. The core of the IOPC library calles the methods through class's prototype - IopcProtoBaseAdaptor.
|
Simple constructor.
|
|
Destructor - destroys protoBaseAdaptor and dbTable if not NULL.
|
|
Is attribute with given number persistent?
Implements IopcClassObject. |
|
Gets IopcProtoBaseAdaptor associated with this object.
Implements IopcClassObject. |
|
Loads attribute with given number together with all the attributes from the same group. Calls loadAttrGroup() using correct parameters.
OID of
Implements IopcClassObject. |
|
Loads persistent object specified by currentObjectOid from the database.
|
|
Loads specified group of attributes of object specified by
|
|
Inserts given object into the database.
Implements IopcClassObject. |
|
Updates given object in database.
Implements IopcClassObject. |
|
Deletes given object from the database.
Gets
Implements IopcClassObject. |
|
Deletes object specified by OID from the database. Deletes object from project's main table, deleting from the other tables is done in the database using cascade delete. Uses deleteObjectSqlStatement.
|
|
Loads Class ID (CID) of object with OID Project's main table is accessed, selectCidSqlStatement is used.
|
|
Gets SELECT statement that selects objects' OID and CID according to given parameters. This function is used when querying some objects from the database (see executeQuery()). Uses DatabaseSqlStatements::generateWhereClauseStmtPart() and DatabaseSqlStatements::generateSelectSql(), the objects are queried using class's polymorphic view (polymorphicViewName).
|
|
Binds currentObjectOid and currentObjectCid as output parameters of query that is executed using cursor Called from IopcProtoBaseAdaptor::_BindKeysAndClassIdentificatingAttributes().
|
|
Returns OID of object received as a result of executing a query on this class object. The object could be later loaded using loadObject().
|
|
Sets OID of object that will be loaded by the next loadObject() call.
|
|
Returns class object for object with OID currentObjectOid. Uses currentObjectCid.
|
|
Returns number that should be used as OID when adding new object into the database. Executes selectNextOidSqlStatement using given connection and fetches received value.
|
|
Replaces attribute names in Called when executing user's query (see executeQuery()).
|
|
Translates given ORDER BY clause (of a SQL statement).
|
|
Executes given query, uses class's polymorphic view.
Implements IopcClassObject. |
|
Creates instance of class represented by this IopcClassObjectImpl. Initializes createInstanceFnc using IopcClassFactory::getClass() if needed. |
|
Creates a new DBNULL reference to represented class. Initializes createReferenceFnc using IopcClassFactory::getClass() if needed. |
|
Returns Class ID (CID) of represented class.
|
|
Function used for SQL statement parsing.
Finds first word (identificator / number / keyword) in string |
|
Prepares all SQL statements that this class object needs. Called when initializing the class object (initialize()). If initializing the first IopcClassObjectImpl instance, calls generateStaticSqlStmts(). Always calls generateLoadAttrGroupSqlStmts() and generateInsertObjectSqlStmt().
|
|
Generates static SQL statements - i.e. the statements that are the same for all user's persistent classes. Uses various functions from DatabaseSqlStatements interface. The generated statements are stored in these attributes:
|
|
Generates SQL statements that load individual attribute groups from the database. Iterates through groups, calls generateLoadAttrGroupSqlStmt() for each group, fills received strings into AttrGroup::selectStmt-s.
|
|
Generates SQL statement that loads given attribute group from the database.
|
|
Generates SQL statement that inserts row into the table associated with the represented persistent class (dbTable's TableInfo::insertSqlStatement). If there's no associated table (i.e. dbTable is NULL), does nothing.
|
|
Method called after IopcClassObjectContainer has filled metadata dependent values of this object.
|
|
Initializes insertUpdateTableList. Creates list of tables, into that some data from instances of the represented class should be put. For each of the tables calls createInsertUpdateTableBitFields().
|
|
Initializes given InsertUpdateTableInfo struct.
Iterates through this class's attributes and attributes in See InsertUpdateTableInfo for further details. |
|
Name of the represented class.
|
|
What type of mapping the represented class uses?
|
|
Information about the table associated with the represented class. NULL if no such table.
|
|
Class object that represents class in whose table attributes of class represented by this object should be stored. Used only if the represented class uses filtered mapping. |
|
Attributes of the represented class.
|
|
Attribute groups of the represented class.
|
|
Class objects that represent parents of the represented class.
|
|
Class objects that represent children of the represented class.
|
|
OID of object that is currently manipulated by the layer. This attribute is bound by bindOidAndCid() when executing some query (executeQuery()). The value is used by loadObject(). |
|
Class ID of the object with OID currentObjectOid. See currentObjectOid for further details. |
|
Pointer to function that creates instances of the represented class.
|
|
Pointer to function that creates references to instances of the represented class.
|
|
Flag used in fillInsertUpdateTableList().
|
|
Array used when transferring data between object's attributes and the database
|
|
Class ID of the represented class. |
|
Name of represented class's polymorphic view.
|
|
Name of represented class's simple view.
|
|
Information about tables into which some data should be put when inserting instance of the represented class into the database or updating class's instance in the database.
|
|
SQL statement that selects OID for new object that is inserted into the database.
|
|
SQL statement that insert information about an object into project's main table. The inserted row contains two entries - object's Class ID and object's OID.
|
|
SQL statement that is used when deleting a persistent object from the database.
|
|
Prepared WHERE clause used when generating UPDATE SQL commands in updateObject(). The WHERE clause looks like this . The OID will be bound into the SQL statement when using it.
|
|
SQL statement that selects object's Class ID for given OID. The statement queries project's main table.
|
|
Locking strategy used when generating load attribute group SQL statements. See generateSqlStatements() for further details. |
|
Waiting strategy used when generating load attribute group SQL statements. See generateSqlStatements() for further details. |
|
IopcProtoBaseAdaptor asociated with this class object
|