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.
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.