An DataModel object describes a schema — a collection of entities (data models) that you use in your application. More...
#include <DataModel.h>
Public Member Functions | |
StringSet & | keysForEntity (string anEntity) |
Ask for the data model of given entity. | |
Protected Member Functions | |
DataModel () | |
Default constructor. | |
virtual | ~DataModel () |
Default destructor. | |
Private Attributes | |
map< std::string, StringSet * > | _models |
Friends | |
class | Singleton< DataModel > |
An DataModel object describes a schema — a collection of entities (data models) that you use in your application.
The model contains one or more objects representing the entities in the schema. Each entity name object has property description objects that represent the properties (or fields) of the entity in the schema.
DataModel::DataModel | ( | ) | [protected] |
Default constructor.
References LOG_CTOR.
DataModel::~DataModel | ( | ) | [protected, virtual] |
StringSet & DataModel::keysForEntity | ( | string | anEntity | ) |
Ask for the data model of given entity.
The first time the method keysForEntity() is called, the class asks the database for attributes list of given entity, while immediately returns the same information whenever the same question is issued again.
[in] | anEntity | Entity name |
References _models, Database::getConnection(), Singleton< DataModel >::instance(), and LOG.
Referenced by ManagedObject::initEntity().
map<std::string, StringSet *> DataModel::_models [private] |
Referenced by keysForEntity(), and ~DataModel().