Please note: this project is inactive since early 2006

2.6.1 Simple models (no inheritance)

If your UML/object model has no inheritance hierarchy, the modelization of the mapping between the object world and the relational world is quite straightforward.

Mapping classes to entities

You first need to create one entity per class. You then populate each entity with the attributes and relationships -see 2.6.2- that are in your UML model.

Each of these entity needs to have a primary key. A primary key is typically an attribute which is not a class property, that is required, whose python type is integer and SQL type (the so-called external type) INTEGER. A primary key is usually named id but this is ultimately up to you. Primary keys should not be made class properties, and as a consequence they won't be accessible in the python object ; this is intended and should not be changed (see also: B.1, ''FAQ'').

For regular attributes and their properties, see 2.3.3. Note that there is no way to map a class attribute: only instance attributes can be used here.

For relationships, you will need to have your primary keys and some foreign keys prepared: section 2.6.2 gives the details of their definition.

Comments are welcome: Sebastien Bigaret / Modeling Home Page
Hosted Logo