+ // Build dot graph input (assuming foreign keys not already present...)
+ let mldDot = 'graph {\n';
+ // Pass 1: initialize tables
+ let tables = [ ];
+ Object.keys(this.entities).forEach( name => {
+ tables.push({ name: this.entities[name] }); //TODO: should be a (deep) copy
+ });
+ // Pass 2: parse associations, add foreign keys + new tables
+ this.associations.forEach( a => {
+ a.entities.forEach( e => { // e.card e.name ...
+ switch (e.card)
+ {
+ case '?':
+ case '?R': //"weak tables" foreign keys become part of the key
+ // TODO
+ // multi-arite : sub-loop si 0,1 ou 1,1 : aspiré comme attribut de l'association (phase 1)
+ // ensuite, que du 0,n ou 1,n : si == 1, OK une table
+ // si 2 ou + : n tables + 1 pour l'assoce, avec attrs clés étrangères
+ // clé étrangère NOT NULL si 1,1
+ });
+ });