Please note: this project is inactive since early 2006

 
2.3.1 Model

A model element may have the following attributes:

name:
The name of a model is just informative and is not used at run-time. It is however required. Note that models are intended to be loaded within a Model Set at runtime, and that a model set identifies its models by name. Hence, two models having the same name cannot be loaded at the same time within the framework.

adaptorName:
the name of the database-adaptor, i.e. the back-end that you want to use for the entities in the model. Currently only MySQL, Oracle , Postgresql and SQLite (exact spelling) are valid adaptorNames (correspond respectively to the packages MySQLAdaptorLayer, OracleAdaptorLayer, PostgresqlAdaptorLayer and SQLiteAdaptorLayer).

packageName:
the name of the package where your classes will be dropped. This will be used when you will ask for generation of code-skeletons for the whole model ; moreover, it implies that all classes mapped to the entities in a model must live within the same package.

Dotted-names are supported. This is used both when the code-templates are generated and at run-time, when objects of a certain type (entity) must be instanciated and populated with fetched values. The value stored in the model should therefore be kept in step with your current python installation.

See also: 2.3.2, Entity's properties className and moduleName, and B.1, FAQ.

comment:
a comment, for maintainers of the model.

connectionDictionary:
this may be the full connection dictionary, as required by the Adaptor chosen above, or a partial connection dictionary - in which case the equivalent keys will be read from the configuration file pointed to by the the enviroment variable MDL_DB_CONNECTIONS_CFG (see A.1).

A connection dictionary is always made of the following keys: host, database, user, and password. An additional key: port allows you to specify the port number to which the database server listens.

The adaptors in the framework make a different use of each of these keys to connect to a database. For example, the adaptor for SQLite only requires one key to be defined: database, pointing to the file containing the database. For an exact definition of how different adaptors use the connection dictionary, please refer to their respective documentation:

MySQL:
MySQLAdaptorLayer

Oracle:
OracleAdaptorLayer

PostgresqlSQL:
PostgresqlAdaptorLayer

SQLite:
SQLiteAdaptorLayer

Comments are welcome: Sebastien Bigaret / Modeling Home Page
Hosted by:SourceForge.net Logo