From c1a9c6c609ebd50680d015e96f8f013b740329b4 Mon Sep 17 00:00:00 2001 From: Aristide Date: Wed, 16 Oct 2024 10:39:29 +0200 Subject: [PATCH] handle strengthening after inheritance (fix #118) --- mocodo/convert/relations.py | 17 +- test/zoo/inheritance_weak/_strong_child_0.mcd | 11 ++ test/zoo/inheritance_weak/_strong_child_1.mcd | 11 ++ test/zoo/inheritance_weak/_strong_child_2.mcd | 11 ++ .../ddl/strong_child_0_ddl.d2 | 28 +++ .../ddl/strong_child_0_ddl.dbml | 31 +++ .../ddl/strong_child_0_ddl.sql | 34 ++++ .../ddl/strong_child_1_ddl.d2 | 18 ++ .../ddl/strong_child_1_ddl.dbml | 21 ++ .../ddl/strong_child_1_ddl.sql | 20 ++ .../ddl/strong_child_2_ddl.d2 | 25 +++ .../ddl/strong_child_2_ddl.dbml | 28 +++ .../ddl/strong_child_2_ddl.sql | 28 +++ .../exported/strong_child_0_erd_chen.gv | 71 +++++++ .../exported/strong_child_0_erd_chen.svg | 186 ++++++++++++++++++ .../exported/strong_child_0_erd_chen.txt | 2 + .../exported/strong_child_0_erd_crow.gv | 112 +++++++++++ .../exported/strong_child_0_erd_crow.mmd | 20 ++ .../exported/strong_child_0_erd_crow.svg | 105 ++++++++++ .../exported/strong_child_0_uml.puml | 36 ++++ .../exported/strong_child_1_erd_chen.gv | 71 +++++++ .../exported/strong_child_1_erd_chen.svg | 186 ++++++++++++++++++ .../exported/strong_child_1_erd_chen.txt | 2 + .../exported/strong_child_1_erd_crow.gv | 112 +++++++++++ .../exported/strong_child_1_erd_crow.mmd | 20 ++ .../exported/strong_child_1_erd_crow.svg | 105 ++++++++++ .../exported/strong_child_1_uml.puml | 36 ++++ .../exported/strong_child_2_erd_chen.gv | 71 +++++++ .../exported/strong_child_2_erd_chen.svg | 186 ++++++++++++++++++ .../exported/strong_child_2_erd_chen.txt | 2 + .../exported/strong_child_2_erd_crow.gv | 112 +++++++++++ .../exported/strong_child_2_erd_crow.mmd | 20 ++ .../exported/strong_child_2_erd_crow.svg | 105 ++++++++++ .../exported/strong_child_2_uml.puml | 36 ++++ .../mld/strong_child_0_debug.tsv | 14 ++ .../mld/strong_child_0_dependencies.gv | 6 + .../mld/strong_child_0_dependencies.svg | 54 +++++ .../mld/strong_child_0_mld.html | 72 +++++++ .../mld/strong_child_0_mld.mcd | 16 ++ .../mld/strong_child_0_mld.md | 16 ++ .../mld/strong_child_0_mld.svg | 81 ++++++++ .../mld/strong_child_0_mld.tex | 46 +++++ .../mld/strong_child_0_mld.txt | 16 ++ .../mld/strong_child_1_debug.tsv | 12 ++ .../mld/strong_child_1_dependencies.gv | 4 + .../mld/strong_child_1_dependencies.svg | 30 +++ .../mld/strong_child_1_mld.html | 56 ++++++ .../mld/strong_child_1_mld.mcd | 8 + .../mld/strong_child_1_mld.md | 12 ++ .../mld/strong_child_1_mld.svg | 45 +++++ .../mld/strong_child_1_mld.tex | 38 ++++ .../mld/strong_child_1_mld.txt | 12 ++ .../mld/strong_child_2_debug.tsv | 16 ++ .../mld/strong_child_2_dependencies.gv | 4 + .../mld/strong_child_2_dependencies.svg | 30 +++ .../mld/strong_child_2_mld.html | 71 +++++++ .../mld/strong_child_2_mld.mcd | 11 ++ .../mld/strong_child_2_mld.md | 18 ++ .../mld/strong_child_2_mld.svg | 61 ++++++ .../mld/strong_child_2_mld.tex | 46 +++++ .../mld/strong_child_2_mld.txt | 18 ++ ...ong_child_0_rw_create_df_arrows=across.mcd | 11 ++ ...ong_child_0_rw_create_df_arrows=across.svg | 87 ++++++++ .../rewritten/strong_child_0_rw_drain.mcd | 1 + .../rewritten/strong_child_0_rw_drown.mcd | 11 ++ .../rewritten/strong_child_0_rw_drown.svg | 86 ++++++++ ...strong_child_0_rw_explode_arity=2,weak.mcd | 1 + ...rong_child_0_rw_explode_arity=2.5,weak.mcd | 1 + .../strong_child_0_rw_explode_arity=2.5.mcd | 1 + .../strong_child_0_rw_explode_arity=2.mcd | 1 + ...strong_child_0_rw_explode_arity=3,weak.mcd | 1 + .../strong_child_0_rw_explode_arity=3.mcd | 1 + .../rewritten/strong_child_0_rw_split.mcd | 1 + ...ong_child_1_rw_create_df_arrows=across.mcd | 11 ++ ...ong_child_1_rw_create_df_arrows=across.svg | 86 ++++++++ .../rewritten/strong_child_1_rw_drain.mcd | 1 + .../rewritten/strong_child_1_rw_drown.mcd | 11 ++ .../rewritten/strong_child_1_rw_drown.svg | 85 ++++++++ ...strong_child_1_rw_explode_arity=2,weak.mcd | 1 + ...rong_child_1_rw_explode_arity=2.5,weak.mcd | 1 + .../strong_child_1_rw_explode_arity=2.5.mcd | 1 + .../strong_child_1_rw_explode_arity=2.mcd | 1 + ...strong_child_1_rw_explode_arity=3,weak.mcd | 1 + .../strong_child_1_rw_explode_arity=3.mcd | 1 + .../rewritten/strong_child_1_rw_split.mcd | 1 + ...ong_child_2_rw_create_df_arrows=across.mcd | 11 ++ ...ong_child_2_rw_create_df_arrows=across.svg | 88 +++++++++ .../rewritten/strong_child_2_rw_drain.mcd | 1 + .../rewritten/strong_child_2_rw_drown.mcd | 11 ++ .../rewritten/strong_child_2_rw_drown.svg | 87 ++++++++ ...strong_child_2_rw_explode_arity=2,weak.mcd | 1 + ...rong_child_2_rw_explode_arity=2.5,weak.mcd | 1 + .../strong_child_2_rw_explode_arity=2.5.mcd | 1 + .../strong_child_2_rw_explode_arity=2.mcd | 1 + ...strong_child_2_rw_explode_arity=3,weak.mcd | 1 + .../strong_child_2_rw_explode_arity=3.mcd | 1 + .../rewritten/strong_child_2_rw_split.mcd | 1 + test/zoo/inheritance_weak/strong_child_0.svg | 86 ++++++++ test/zoo/inheritance_weak/strong_child_1.svg | 85 ++++++++ test/zoo/inheritance_weak/strong_child_2.svg | 87 ++++++++ 100 files changed, 3557 insertions(+), 2 deletions(-) create mode 100644 test/zoo/inheritance_weak/_strong_child_0.mcd create mode 100644 test/zoo/inheritance_weak/_strong_child_1.mcd create mode 100644 test/zoo/inheritance_weak/_strong_child_2.mcd create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_0_ddl.d2 create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_0_ddl.dbml create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_0_ddl.sql create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_1_ddl.d2 create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_1_ddl.dbml create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_1_ddl.sql create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_2_ddl.d2 create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_2_ddl.dbml create mode 100644 test/zoo/inheritance_weak/ddl/strong_child_2_ddl.sql create mode 100644 test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.gv create mode 100644 test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.svg create mode 100644 test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.txt create mode 100644 test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.gv create mode 100644 test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.mmd create mode 100644 test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.svg create mode 100644 test/zoo/inheritance_weak/exported/strong_child_0_uml.puml create mode 100644 test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.gv create mode 100644 test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.svg create mode 100644 test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.txt create mode 100644 test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.gv create mode 100644 test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.mmd create mode 100644 test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.svg create mode 100644 test/zoo/inheritance_weak/exported/strong_child_1_uml.puml create mode 100644 test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.gv create mode 100644 test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.svg create mode 100644 test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.txt create mode 100644 test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.gv create mode 100644 test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.mmd create mode 100644 test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.svg create mode 100644 test/zoo/inheritance_weak/exported/strong_child_2_uml.puml create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_debug.tsv create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_dependencies.gv create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_dependencies.svg create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_mld.html create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_mld.mcd create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_mld.md create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_mld.svg create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_mld.tex create mode 100644 test/zoo/inheritance_weak/mld/strong_child_0_mld.txt create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_debug.tsv create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_dependencies.gv create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_dependencies.svg create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_mld.html create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_mld.mcd create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_mld.md create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_mld.svg create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_mld.tex create mode 100644 test/zoo/inheritance_weak/mld/strong_child_1_mld.txt create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_debug.tsv create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_dependencies.gv create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_dependencies.svg create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_mld.html create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_mld.mcd create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_mld.md create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_mld.svg create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_mld.tex create mode 100644 test/zoo/inheritance_weak/mld/strong_child_2_mld.txt create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.svg create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drain.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.svg create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_0_rw_split.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.svg create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drain.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.svg create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_1_rw_split.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.svg create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drain.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.svg create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3,weak.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3.mcd create mode 100644 test/zoo/inheritance_weak/rewritten/strong_child_2_rw_split.mcd create mode 100644 test/zoo/inheritance_weak/strong_child_0.svg create mode 100644 test/zoo/inheritance_weak/strong_child_1.svg create mode 100644 test/zoo/inheritance_weak/strong_child_2.svg diff --git a/mocodo/convert/relations.py b/mocodo/convert/relations.py index e1c457c5..9b62968e 100755 --- a/mocodo/convert/relations.py +++ b/mocodo/convert/relations.py @@ -81,10 +81,10 @@ def __init__(self, mcd, params): self.freeze_strengthening_foreign_key_migration = set() self.relations = {} self.relations_from_entities() - self.strengthen_weak_identifiers() self.inheritance_parent_or_children_to_delete = self.find_inheritance_parent_or_children_to_delete() self.strengthen_children() self.strengthen_parents() + self.strengthen_weak_identifiers() self.process_associations() self.process_inheritances() self.delete_inheritance_parent_or_children_to_delete() @@ -320,13 +320,26 @@ def strengthen_weak_identifiers(self): break else: leg_note = None + + # Patch for #118: if a child disappears but strengthens a weak entity, the outer source + # of this entity must be the outer source of this child. Otherwise, the relational diagram + # will contains the reference: #parent_id > CHILD > parent_id where CHILD no more exists. + # This doesn't fix #119: in the case of cascading inheritance, the outer source should be + # searched in the parent of the parent, etc. + outer_source = strengthening_entity.name_view + if strengthening_entity.bid in self.inheritance_parent_or_children_to_delete: + for attribute in self.relations[leg.entity_bid]["columns"]: + if attribute["is_primary"]: + outer_source = attribute["outer_source"] + break + # migrate the whole primary key of the strengthening entity into the weak one self.relations[entity.bid]["columns"][0:0] = [{ "attribute": attribute["attribute"], "optionality": "!", "datatype": attribute["datatype"], "adjacent_source": strengthening_entity.name_view, - "outer_source": strengthening_entity.name_view, + "outer_source": outer_source, "association_name": association.name_view, "leg_note": leg_note, "is_primary": True, diff --git a/test/zoo/inheritance_weak/_strong_child_0.mcd b/test/zoo/inheritance_weak/_strong_child_0.mcd new file mode 100644 index 00000000..99b5ae2b --- /dev/null +++ b/test/zoo/inheritance_weak/_strong_child_0.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Class table inheritance: all entities are preserved + +DF, _11 CONTRAT, 1N VACATAIRE +VACATAIRE: statut vacataire + +CONTRAT: date contrat, salaire horaire contrat +/XT\ PROFESSEUR -> VACATAIRE, SALARIÉ +SALARIÉ: date embauche salarié, échelon salarié, salaire salarié + +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof diff --git a/test/zoo/inheritance_weak/_strong_child_1.mcd b/test/zoo/inheritance_weak/_strong_child_1.mcd new file mode 100644 index 00000000..ed188921 --- /dev/null +++ b/test/zoo/inheritance_weak/_strong_child_1.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Single table inheritance: children are merged into the parent table + +DF, _11 CONTRAT, 1N VACATAIRE +VACATAIRE: statut vacataire + +CONTRAT: date contrat, salaire horaire contrat +/XT\ PROFESSEUR <- VACATAIRE, SALARIÉ +SALARIÉ: date embauche salarié, échelon salarié, salaire salarié + +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof diff --git a/test/zoo/inheritance_weak/_strong_child_2.mcd b/test/zoo/inheritance_weak/_strong_child_2.mcd new file mode 100644 index 00000000..dc7c8d59 --- /dev/null +++ b/test/zoo/inheritance_weak/_strong_child_2.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Concrete table inheritance: parent disappears + +DF, _11 CONTRAT, 1N VACATAIRE +VACATAIRE: statut vacataire + +CONTRAT: date contrat, salaire horaire contrat +/XT\ PROFESSEUR => VACATAIRE, SALARIÉ +SALARIÉ: date embauche salarié, échelon salarié, salaire salarié + +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof diff --git a/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.d2 b/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.d2 new file mode 100644 index 00000000..2568fad1 --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.d2 @@ -0,0 +1,28 @@ +"CONTRAT": { shape: sql_table + "num prof": VARCHAR(42) {constraint: [PK; FK]} + "date contrat": VARCHAR(42) {constraint: PK} + "salaire horaire contrat": VARCHAR(42) +} + +"PROFESSEUR": { shape: sql_table + "num prof": VARCHAR(42) {constraint: PK} + "nom prof": VARCHAR(42) + "prénom prof": VARCHAR(42) + "téléphone prof": VARCHAR(42) +} + +"SALARIÉ": { shape: sql_table + "num prof": VARCHAR(42) {constraint: [PK; FK]} + "date embauche salarié": VARCHAR(42) + "échelon salarié": VARCHAR(42) + "salaire salarié": VARCHAR(42) +} + +"VACATAIRE": { shape: sql_table + "num prof": VARCHAR(42) {constraint: [PK; FK]} + "statut vacataire": VARCHAR(42) +} + +"CONTRAT"."num prof" -> "VACATAIRE"."num prof" +"SALARIÉ"."num prof" -> "PROFESSEUR"."num prof" +"VACATAIRE"."num prof" -> "PROFESSEUR"."num prof" diff --git a/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.dbml b/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.dbml new file mode 100644 index 00000000..888a50e6 --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.dbml @@ -0,0 +1,31 @@ +Table "CONTRAT" { + "num prof" VARCHAR(42) [NOT NULL] + "date contrat" VARCHAR(42) [NOT NULL] + "salaire horaire contrat" VARCHAR(42) + Indexes { + ("num prof", "date contrat") [pk] + } +} + +Table "PROFESSEUR" { + "num prof" VARCHAR(42) [pk, NOT NULL] + "nom prof" VARCHAR(42) + "prénom prof" VARCHAR(42) + "téléphone prof" VARCHAR(42) +} + +Table "SALARIÉ" { + "num prof" VARCHAR(42) [pk, NOT NULL] + "date embauche salarié" VARCHAR(42) + "échelon salarié" VARCHAR(42) + "salaire salarié" VARCHAR(42) +} + +Table "VACATAIRE" { + "num prof" VARCHAR(42) [pk, NOT NULL] + "statut vacataire" VARCHAR(42) +} + +Ref:"CONTRAT"."num prof" > "VACATAIRE"."num prof" +Ref:"SALARIÉ"."num prof" > "PROFESSEUR"."num prof" +Ref:"VACATAIRE"."num prof" > "PROFESSEUR"."num prof" diff --git a/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.sql b/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.sql new file mode 100644 index 00000000..5532bae9 --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_0_ddl.sql @@ -0,0 +1,34 @@ +CREATE TABLE CONTRAT ( + PRIMARY KEY (num_prof, date_contrat), + num_prof VARCHAR(8) NOT NULL, + date_contrat DATE NOT NULL, + salaire_horaire_contrat VARCHAR(42) +); + +CREATE TABLE PROFESSEUR ( + PRIMARY KEY (num_prof), + num_prof VARCHAR(8) NOT NULL, + nom_prof VARCHAR(255), + prenom_prof VARCHAR(255), + telephone_prof VARCHAR(20) +); + +CREATE TABLE SALARIE ( + PRIMARY KEY (num_prof), + num_prof VARCHAR(8) NOT NULL, + date_embauche_salarie DATE, + echelon_salarie VARCHAR(42), + salaire_salarie VARCHAR(42) +); + +CREATE TABLE VACATAIRE ( + PRIMARY KEY (num_prof), + num_prof VARCHAR(8) NOT NULL, + statut_vacataire VARCHAR(20) +); + +ALTER TABLE CONTRAT ADD FOREIGN KEY (num_prof) REFERENCES VACATAIRE (num_prof); + +ALTER TABLE SALARIE ADD FOREIGN KEY (num_prof) REFERENCES PROFESSEUR (num_prof); + +ALTER TABLE VACATAIRE ADD FOREIGN KEY (num_prof) REFERENCES PROFESSEUR (num_prof); diff --git a/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.d2 b/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.d2 new file mode 100644 index 00000000..386e81bf --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.d2 @@ -0,0 +1,18 @@ +"CONTRAT": { shape: sql_table + "num prof": VARCHAR(42) {constraint: [PK; FK]} + "date contrat": VARCHAR(42) {constraint: PK} + "salaire horaire contrat": VARCHAR(42) +} + +"PROFESSEUR": { shape: sql_table + "num prof": VARCHAR(42) {constraint: PK} + "nom prof": VARCHAR(42) + "prénom prof": VARCHAR(42) + "téléphone prof": VARCHAR(42) + "statut vacataire": VARCHAR(42) {constraint: "NULL"} + "date embauche salarié": VARCHAR(42) {constraint: "NULL"} + "échelon salarié": VARCHAR(42) {constraint: "NULL"} + "salaire salarié": VARCHAR(42) {constraint: "NULL"} +} + +"CONTRAT"."num prof" -> "PROFESSEUR"."num prof" diff --git a/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.dbml b/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.dbml new file mode 100644 index 00000000..b2e79dc9 --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.dbml @@ -0,0 +1,21 @@ +Table "CONTRAT" { + "num prof" VARCHAR(42) [NOT NULL] + "date contrat" VARCHAR(42) [NOT NULL] + "salaire horaire contrat" VARCHAR(42) + Indexes { + ("num prof", "date contrat") [pk] + } +} + +Table "PROFESSEUR" { + "num prof" VARCHAR(42) [pk, NOT NULL] + "nom prof" VARCHAR(42) + "prénom prof" VARCHAR(42) + "téléphone prof" VARCHAR(42) + "statut vacataire" VARCHAR(42) ["NULL"] + "date embauche salarié" VARCHAR(42) ["NULL"] + "échelon salarié" VARCHAR(42) ["NULL"] + "salaire salarié" VARCHAR(42) ["NULL"] +} + +Ref:"CONTRAT"."num prof" > "PROFESSEUR"."num prof" diff --git a/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.sql b/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.sql new file mode 100644 index 00000000..2911f386 --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_1_ddl.sql @@ -0,0 +1,20 @@ +CREATE TABLE CONTRAT ( + PRIMARY KEY (num_prof, date_contrat), + num_prof VARCHAR(8) NOT NULL, + date_contrat DATE NOT NULL, + salaire_horaire_contrat VARCHAR(42) +); + +CREATE TABLE PROFESSEUR ( + PRIMARY KEY (num_prof), + num_prof VARCHAR(8) NOT NULL, + nom_prof VARCHAR(255), + prenom_prof VARCHAR(255), + telephone_prof VARCHAR(20), + statut_vacataire VARCHAR(20) NULL, + date_embauche_salarie DATE NULL, + echelon_salarie VARCHAR(42) NULL, + salaire_salarie VARCHAR(42) NULL +); + +ALTER TABLE CONTRAT ADD FOREIGN KEY (num_prof) REFERENCES PROFESSEUR (num_prof); diff --git a/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.d2 b/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.d2 new file mode 100644 index 00000000..287bad9a --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.d2 @@ -0,0 +1,25 @@ +"CONTRAT": { shape: sql_table + "num prof": VARCHAR(42) {constraint: [PK; FK]} + "date contrat": VARCHAR(42) {constraint: PK} + "salaire horaire contrat": VARCHAR(42) +} + +"SALARIÉ": { shape: sql_table + "num prof": VARCHAR(42) {constraint: PK} + "nom prof": VARCHAR(42) + "prénom prof": VARCHAR(42) + "téléphone prof": VARCHAR(42) + "date embauche salarié": VARCHAR(42) + "échelon salarié": VARCHAR(42) + "salaire salarié": VARCHAR(42) +} + +"VACATAIRE": { shape: sql_table + "num prof": VARCHAR(42) {constraint: PK} + "nom prof": VARCHAR(42) + "prénom prof": VARCHAR(42) + "téléphone prof": VARCHAR(42) + "statut vacataire": VARCHAR(42) +} + +"CONTRAT"."num prof" -> "VACATAIRE"."num prof" diff --git a/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.dbml b/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.dbml new file mode 100644 index 00000000..f23cba3d --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.dbml @@ -0,0 +1,28 @@ +Table "CONTRAT" { + "num prof" VARCHAR(42) [NOT NULL] + "date contrat" VARCHAR(42) [NOT NULL] + "salaire horaire contrat" VARCHAR(42) + Indexes { + ("num prof", "date contrat") [pk] + } +} + +Table "SALARIÉ" { + "num prof" VARCHAR(42) [pk, NOT NULL] + "nom prof" VARCHAR(42) + "prénom prof" VARCHAR(42) + "téléphone prof" VARCHAR(42) + "date embauche salarié" VARCHAR(42) + "échelon salarié" VARCHAR(42) + "salaire salarié" VARCHAR(42) +} + +Table "VACATAIRE" { + "num prof" VARCHAR(42) [pk, NOT NULL] + "nom prof" VARCHAR(42) + "prénom prof" VARCHAR(42) + "téléphone prof" VARCHAR(42) + "statut vacataire" VARCHAR(42) +} + +Ref:"CONTRAT"."num prof" > "VACATAIRE"."num prof" diff --git a/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.sql b/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.sql new file mode 100644 index 00000000..40286c8f --- /dev/null +++ b/test/zoo/inheritance_weak/ddl/strong_child_2_ddl.sql @@ -0,0 +1,28 @@ +CREATE TABLE CONTRAT ( + PRIMARY KEY (num_prof, date_contrat), + num_prof VARCHAR(8) NOT NULL, + date_contrat DATE NOT NULL, + salaire_horaire_contrat VARCHAR(42) +); + +CREATE TABLE SALARIE ( + PRIMARY KEY (num_prof), + num_prof VARCHAR(8) NOT NULL, + nom_prof VARCHAR(255), + prenom_prof VARCHAR(255), + telephone_prof VARCHAR(20), + date_embauche_salarie DATE, + echelon_salarie VARCHAR(42), + salaire_salarie VARCHAR(42) +); + +CREATE TABLE VACATAIRE ( + PRIMARY KEY (num_prof), + num_prof VARCHAR(8) NOT NULL, + nom_prof VARCHAR(255), + prenom_prof VARCHAR(255), + telephone_prof VARCHAR(20), + statut_vacataire VARCHAR(20) +); + +ALTER TABLE CONTRAT ADD FOREIGN KEY (num_prof) REFERENCES VACATAIRE (num_prof); diff --git a/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.gv b/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.gv new file mode 100644 index 00000000..266e8c8f --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.gv @@ -0,0 +1,71 @@ +graph{ + start=42 + + // Entities + node [ + shape=box + style=filled + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 3 [label="VACATAIRE"] + 2 [label="CONTRAT",peripheries=2] + + // Associative entities + 7 [label="SALARIÉ",shape=Mdiamond] + 11 [label="PROFESSEUR",shape=Mdiamond] + + // Normal entity attributes + node [ + shape=oval + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 6 [label="salaire\nhoraire\ncontrat"] + 9 [label="échelon\nsalarié"] + 10 [label="salaire\nsalarié"] + 13 [label="nom prof"] + 14 [label="prénom\nprof"] + 15 [label="téléphone\nprof"] + + // Weak and strong entity attributes + 4 [label=<statut
vacataire
>] + 5 [label=<date
contrat
> style="dashed,filled"] + 8 [label=<date
embauche
salarié
>] + 12 [label=<num prof>] + + // Relationships + node [ + shape=diamond + height=0.7 + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 1 [label="DF",peripheries=2] + + // Edges between entities and attributes + edge [ + penwidth=1.5 + ] + 2 -- 5 + 2 -- 6 + 3 -- 4 + 7 -- 8 + 7 -- 9 + 7 -- 10 + 11 -- 12 + 11 -- 13 + 11 -- 14 + 11 -- 15 + + // Edges between entities and relationships + edge [ + penwidth=1 + color="#000000:#000000" + labeldistance=2 + headlabel=1 + ] + 3 -- 1 + edge [headlabel=N] + 2 -- 1 +} \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.svg b/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.svg new file mode 100644 index 00000000..cdf393da --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.svg @@ -0,0 +1,186 @@ + + + + + + + + + +3 + +VACATAIRE + + + +4 + +statut +vacataire + + + +3--4 + + + + +1 + + +DF + + + +3--1 + + +1 + + + +2 + + +CONTRAT + + + +6 + +salaire +horaire +contrat + + + +2--6 + + + + +5 + +date +contrat + + + +2--5 + + + + +2--1 + + +N + + + +7 + + + + + +SALARIÉ + + + +9 + +échelon +salarié + + + +7--9 + + + + +10 + +salaire +salarié + + + +7--10 + + + + +8 + +date +embauche +salarié + + + +7--8 + + + + +11 + + + + + +PROFESSEUR + + + +13 + +nom prof + + + +11--13 + + + + +14 + +prénom +prof + + + +11--14 + + + + +15 + +téléphone +prof + + + +11--15 + + + + +12 + +num prof + + + +11--12 + + + + diff --git a/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.txt b/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.txt new file mode 100644 index 00000000..dc4a1769 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_0_erd_chen.txt @@ -0,0 +1,2 @@ +[VACATAIRE] ==1== <> +[[CONTRAT]] ==N== <> diff --git a/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.gv b/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.gv new file mode 100644 index 00000000..72b10ae7 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.gv @@ -0,0 +1,112 @@ +digraph{ + layout=dot + bgcolor="#FFFFFF" + nodesep=0.5 + + // Nodes + node [ + shape=none + fontcolor="#000000" + fontsize=15 + fontname="Helvetica" +] + node [ + shape=none + fontcolor="#000000" + fontsize=15 + fontname="Helvetica" +] + 1 [label=< + + + + +
+ VACATAIRE +
PKstatut vacataire
+>] + 2 [label=< + + + + + +
+ CONTRAT +
PKdate contrat
salaire horaire contrat
+>] + 3 [label=< + + + + + + +
+ SALARIÉ +
PKdate embauche salarié
échelon salarié
salaire salarié
+>] + 4 [label=< + + + + + + + +
+ PROFESSEUR +
PKnum prof
nom prof
prénom prof
téléphone prof
+>] + + // Edges + edge [ + penwidth=1 + color="#000000" + fontcolor="#000000" + fontname="Futura" + fontsize=11 + dir=both + ] + 2 -> 1 [arrowhead="teetee" arrowtail="crowtee" label="DF" style=dotted] +} \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.mmd b/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.mmd new file mode 100644 index 00000000..cc320a3d --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.mmd @@ -0,0 +1,20 @@ +erDiagram + VACATAIRE { + TYPE statut_vacataire PK + } + CONTRAT { + TYPE date_contrat PK + TYPE salaire_horaire_contrat + } + SALARIE { + TYPE date_embauche_salarie PK + TYPE echelon_salarie + TYPE salaire_salarie + } + PROFESSEUR { + TYPE num_prof PK + TYPE nom_prof + TYPE prenom_prof + TYPE telephone_prof + } + CONTRAT }|..|| VACATAIRE: DF \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.svg b/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.svg new file mode 100644 index 00000000..62946865 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_0_erd_crow.svg @@ -0,0 +1,105 @@ + + + + + + + + + +1 + + + +                 +VACATAIRE +             + +PK + +statut vacataire + + + +2 + + + +                 +CONTRAT +             + +PK + +date contrat + + + +salaire horaire contrat + + + +2->1 + + + + + + + + +DF + + + +3 + + + +                 +SALARIÉ +             + +PK + +date embauche salarié + + + +échelon salarié + + + +salaire salarié + + + +4 + + + +                 +PROFESSEUR +             + +PK + +num prof + + + +nom prof + + + +prénom prof + + + +téléphone prof + + + diff --git a/test/zoo/inheritance_weak/exported/strong_child_0_uml.puml b/test/zoo/inheritance_weak/exported/strong_child_0_uml.puml new file mode 100644 index 00000000..8cc3610a --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_0_uml.puml @@ -0,0 +1,36 @@ +@startuml "inheritance_weak" + +!define Table(x) class "x" << (T,#FFFFFF) >> +!define pk(x) x + +"CONTRAT" "1..*" --* "1" "VACATAIRE" + +Table("VACATAIRE") { + {field} + pk(statut vacataire) +} + +Table("CONTRAT") { + {field} + pk(date contrat) + {field} + salaire horaire contrat +} + +note "{complete, disjoint}" as GENERALIZATION_0 +GENERALIZATION_0 -[dotted]- SALARIÉ +GENERALIZATION_0 -[dotted]- VACATAIRE +PROFESSEUR <|-- SALARIÉ +PROFESSEUR <|-- VACATAIRE + +Table("SALARIÉ") { + {field} + pk(date embauche salarié) + {field} + échelon salarié + {field} + salaire salarié +} + +Table("PROFESSEUR") { + {field} + pk(num prof) + {field} + nom prof + {field} + prénom prof + {field} + téléphone prof +} + +@enduml diff --git a/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.gv b/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.gv new file mode 100644 index 00000000..266e8c8f --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.gv @@ -0,0 +1,71 @@ +graph{ + start=42 + + // Entities + node [ + shape=box + style=filled + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 3 [label="VACATAIRE"] + 2 [label="CONTRAT",peripheries=2] + + // Associative entities + 7 [label="SALARIÉ",shape=Mdiamond] + 11 [label="PROFESSEUR",shape=Mdiamond] + + // Normal entity attributes + node [ + shape=oval + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 6 [label="salaire\nhoraire\ncontrat"] + 9 [label="échelon\nsalarié"] + 10 [label="salaire\nsalarié"] + 13 [label="nom prof"] + 14 [label="prénom\nprof"] + 15 [label="téléphone\nprof"] + + // Weak and strong entity attributes + 4 [label=<statut
vacataire
>] + 5 [label=<date
contrat
> style="dashed,filled"] + 8 [label=<date
embauche
salarié
>] + 12 [label=<num prof>] + + // Relationships + node [ + shape=diamond + height=0.7 + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 1 [label="DF",peripheries=2] + + // Edges between entities and attributes + edge [ + penwidth=1.5 + ] + 2 -- 5 + 2 -- 6 + 3 -- 4 + 7 -- 8 + 7 -- 9 + 7 -- 10 + 11 -- 12 + 11 -- 13 + 11 -- 14 + 11 -- 15 + + // Edges between entities and relationships + edge [ + penwidth=1 + color="#000000:#000000" + labeldistance=2 + headlabel=1 + ] + 3 -- 1 + edge [headlabel=N] + 2 -- 1 +} \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.svg b/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.svg new file mode 100644 index 00000000..cdf393da --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.svg @@ -0,0 +1,186 @@ + + + + + + + + + +3 + +VACATAIRE + + + +4 + +statut +vacataire + + + +3--4 + + + + +1 + + +DF + + + +3--1 + + +1 + + + +2 + + +CONTRAT + + + +6 + +salaire +horaire +contrat + + + +2--6 + + + + +5 + +date +contrat + + + +2--5 + + + + +2--1 + + +N + + + +7 + + + + + +SALARIÉ + + + +9 + +échelon +salarié + + + +7--9 + + + + +10 + +salaire +salarié + + + +7--10 + + + + +8 + +date +embauche +salarié + + + +7--8 + + + + +11 + + + + + +PROFESSEUR + + + +13 + +nom prof + + + +11--13 + + + + +14 + +prénom +prof + + + +11--14 + + + + +15 + +téléphone +prof + + + +11--15 + + + + +12 + +num prof + + + +11--12 + + + + diff --git a/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.txt b/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.txt new file mode 100644 index 00000000..dc4a1769 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_1_erd_chen.txt @@ -0,0 +1,2 @@ +[VACATAIRE] ==1== <> +[[CONTRAT]] ==N== <> diff --git a/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.gv b/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.gv new file mode 100644 index 00000000..72b10ae7 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.gv @@ -0,0 +1,112 @@ +digraph{ + layout=dot + bgcolor="#FFFFFF" + nodesep=0.5 + + // Nodes + node [ + shape=none + fontcolor="#000000" + fontsize=15 + fontname="Helvetica" +] + node [ + shape=none + fontcolor="#000000" + fontsize=15 + fontname="Helvetica" +] + 1 [label=< + + + + +
+ VACATAIRE +
PKstatut vacataire
+>] + 2 [label=< + + + + + +
+ CONTRAT +
PKdate contrat
salaire horaire contrat
+>] + 3 [label=< + + + + + + +
+ SALARIÉ +
PKdate embauche salarié
échelon salarié
salaire salarié
+>] + 4 [label=< + + + + + + + +
+ PROFESSEUR +
PKnum prof
nom prof
prénom prof
téléphone prof
+>] + + // Edges + edge [ + penwidth=1 + color="#000000" + fontcolor="#000000" + fontname="Futura" + fontsize=11 + dir=both + ] + 2 -> 1 [arrowhead="teetee" arrowtail="crowtee" label="DF" style=dotted] +} \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.mmd b/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.mmd new file mode 100644 index 00000000..cc320a3d --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.mmd @@ -0,0 +1,20 @@ +erDiagram + VACATAIRE { + TYPE statut_vacataire PK + } + CONTRAT { + TYPE date_contrat PK + TYPE salaire_horaire_contrat + } + SALARIE { + TYPE date_embauche_salarie PK + TYPE echelon_salarie + TYPE salaire_salarie + } + PROFESSEUR { + TYPE num_prof PK + TYPE nom_prof + TYPE prenom_prof + TYPE telephone_prof + } + CONTRAT }|..|| VACATAIRE: DF \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.svg b/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.svg new file mode 100644 index 00000000..62946865 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_1_erd_crow.svg @@ -0,0 +1,105 @@ + + + + + + + + + +1 + + + +                 +VACATAIRE +             + +PK + +statut vacataire + + + +2 + + + +                 +CONTRAT +             + +PK + +date contrat + + + +salaire horaire contrat + + + +2->1 + + + + + + + + +DF + + + +3 + + + +                 +SALARIÉ +             + +PK + +date embauche salarié + + + +échelon salarié + + + +salaire salarié + + + +4 + + + +                 +PROFESSEUR +             + +PK + +num prof + + + +nom prof + + + +prénom prof + + + +téléphone prof + + + diff --git a/test/zoo/inheritance_weak/exported/strong_child_1_uml.puml b/test/zoo/inheritance_weak/exported/strong_child_1_uml.puml new file mode 100644 index 00000000..8cc3610a --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_1_uml.puml @@ -0,0 +1,36 @@ +@startuml "inheritance_weak" + +!define Table(x) class "x" << (T,#FFFFFF) >> +!define pk(x) x + +"CONTRAT" "1..*" --* "1" "VACATAIRE" + +Table("VACATAIRE") { + {field} + pk(statut vacataire) +} + +Table("CONTRAT") { + {field} + pk(date contrat) + {field} + salaire horaire contrat +} + +note "{complete, disjoint}" as GENERALIZATION_0 +GENERALIZATION_0 -[dotted]- SALARIÉ +GENERALIZATION_0 -[dotted]- VACATAIRE +PROFESSEUR <|-- SALARIÉ +PROFESSEUR <|-- VACATAIRE + +Table("SALARIÉ") { + {field} + pk(date embauche salarié) + {field} + échelon salarié + {field} + salaire salarié +} + +Table("PROFESSEUR") { + {field} + pk(num prof) + {field} + nom prof + {field} + prénom prof + {field} + téléphone prof +} + +@enduml diff --git a/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.gv b/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.gv new file mode 100644 index 00000000..266e8c8f --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.gv @@ -0,0 +1,71 @@ +graph{ + start=42 + + // Entities + node [ + shape=box + style=filled + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 3 [label="VACATAIRE"] + 2 [label="CONTRAT",peripheries=2] + + // Associative entities + 7 [label="SALARIÉ",shape=Mdiamond] + 11 [label="PROFESSEUR",shape=Mdiamond] + + // Normal entity attributes + node [ + shape=oval + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 6 [label="salaire\nhoraire\ncontrat"] + 9 [label="échelon\nsalarié"] + 10 [label="salaire\nsalarié"] + 13 [label="nom prof"] + 14 [label="prénom\nprof"] + 15 [label="téléphone\nprof"] + + // Weak and strong entity attributes + 4 [label=<statut
vacataire
>] + 5 [label=<date
contrat
> style="dashed,filled"] + 8 [label=<date
embauche
salarié
>] + 12 [label=<num prof>] + + // Relationships + node [ + shape=diamond + height=0.7 + penwidth=1.5 + fillcolor="#FFFFFF" + ] + 1 [label="DF",peripheries=2] + + // Edges between entities and attributes + edge [ + penwidth=1.5 + ] + 2 -- 5 + 2 -- 6 + 3 -- 4 + 7 -- 8 + 7 -- 9 + 7 -- 10 + 11 -- 12 + 11 -- 13 + 11 -- 14 + 11 -- 15 + + // Edges between entities and relationships + edge [ + penwidth=1 + color="#000000:#000000" + labeldistance=2 + headlabel=1 + ] + 3 -- 1 + edge [headlabel=N] + 2 -- 1 +} \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.svg b/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.svg new file mode 100644 index 00000000..cdf393da --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.svg @@ -0,0 +1,186 @@ + + + + + + + + + +3 + +VACATAIRE + + + +4 + +statut +vacataire + + + +3--4 + + + + +1 + + +DF + + + +3--1 + + +1 + + + +2 + + +CONTRAT + + + +6 + +salaire +horaire +contrat + + + +2--6 + + + + +5 + +date +contrat + + + +2--5 + + + + +2--1 + + +N + + + +7 + + + + + +SALARIÉ + + + +9 + +échelon +salarié + + + +7--9 + + + + +10 + +salaire +salarié + + + +7--10 + + + + +8 + +date +embauche +salarié + + + +7--8 + + + + +11 + + + + + +PROFESSEUR + + + +13 + +nom prof + + + +11--13 + + + + +14 + +prénom +prof + + + +11--14 + + + + +15 + +téléphone +prof + + + +11--15 + + + + +12 + +num prof + + + +11--12 + + + + diff --git a/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.txt b/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.txt new file mode 100644 index 00000000..dc4a1769 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_2_erd_chen.txt @@ -0,0 +1,2 @@ +[VACATAIRE] ==1== <> +[[CONTRAT]] ==N== <> diff --git a/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.gv b/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.gv new file mode 100644 index 00000000..72b10ae7 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.gv @@ -0,0 +1,112 @@ +digraph{ + layout=dot + bgcolor="#FFFFFF" + nodesep=0.5 + + // Nodes + node [ + shape=none + fontcolor="#000000" + fontsize=15 + fontname="Helvetica" +] + node [ + shape=none + fontcolor="#000000" + fontsize=15 + fontname="Helvetica" +] + 1 [label=< + + + + +
+ VACATAIRE +
PKstatut vacataire
+>] + 2 [label=< + + + + + +
+ CONTRAT +
PKdate contrat
salaire horaire contrat
+>] + 3 [label=< + + + + + + +
+ SALARIÉ +
PKdate embauche salarié
échelon salarié
salaire salarié
+>] + 4 [label=< + + + + + + + +
+ PROFESSEUR +
PKnum prof
nom prof
prénom prof
téléphone prof
+>] + + // Edges + edge [ + penwidth=1 + color="#000000" + fontcolor="#000000" + fontname="Futura" + fontsize=11 + dir=both + ] + 2 -> 1 [arrowhead="teetee" arrowtail="crowtee" label="DF" style=dotted] +} \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.mmd b/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.mmd new file mode 100644 index 00000000..cc320a3d --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.mmd @@ -0,0 +1,20 @@ +erDiagram + VACATAIRE { + TYPE statut_vacataire PK + } + CONTRAT { + TYPE date_contrat PK + TYPE salaire_horaire_contrat + } + SALARIE { + TYPE date_embauche_salarie PK + TYPE echelon_salarie + TYPE salaire_salarie + } + PROFESSEUR { + TYPE num_prof PK + TYPE nom_prof + TYPE prenom_prof + TYPE telephone_prof + } + CONTRAT }|..|| VACATAIRE: DF \ No newline at end of file diff --git a/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.svg b/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.svg new file mode 100644 index 00000000..62946865 --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_2_erd_crow.svg @@ -0,0 +1,105 @@ + + + + + + + + + +1 + + + +                 +VACATAIRE +             + +PK + +statut vacataire + + + +2 + + + +                 +CONTRAT +             + +PK + +date contrat + + + +salaire horaire contrat + + + +2->1 + + + + + + + + +DF + + + +3 + + + +                 +SALARIÉ +             + +PK + +date embauche salarié + + + +échelon salarié + + + +salaire salarié + + + +4 + + + +                 +PROFESSEUR +             + +PK + +num prof + + + +nom prof + + + +prénom prof + + + +téléphone prof + + + diff --git a/test/zoo/inheritance_weak/exported/strong_child_2_uml.puml b/test/zoo/inheritance_weak/exported/strong_child_2_uml.puml new file mode 100644 index 00000000..8cc3610a --- /dev/null +++ b/test/zoo/inheritance_weak/exported/strong_child_2_uml.puml @@ -0,0 +1,36 @@ +@startuml "inheritance_weak" + +!define Table(x) class "x" << (T,#FFFFFF) >> +!define pk(x) x + +"CONTRAT" "1..*" --* "1" "VACATAIRE" + +Table("VACATAIRE") { + {field} + pk(statut vacataire) +} + +Table("CONTRAT") { + {field} + pk(date contrat) + {field} + salaire horaire contrat +} + +note "{complete, disjoint}" as GENERALIZATION_0 +GENERALIZATION_0 -[dotted]- SALARIÉ +GENERALIZATION_0 -[dotted]- VACATAIRE +PROFESSEUR <|-- SALARIÉ +PROFESSEUR <|-- VACATAIRE + +Table("SALARIÉ") { + {field} + pk(date embauche salarié) + {field} + échelon salarié + {field} + salaire salarié +} + +Table("PROFESSEUR") { + {field} + pk(num prof) + {field} + nom prof + {field} + prénom prof + {field} + téléphone prof +} + +@enduml diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_debug.tsv b/test/zoo/inheritance_weak/mld/strong_child_0_debug.tsv new file mode 100644 index 00000000..9058384b --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_debug.tsv @@ -0,0 +1,14 @@ +this relation name attribute optionality unicities nature is primary adjacent source outer source association name datatype leg note +CONTRAT num prof ! strengthening_primary_foreign_key True VACATAIRE VACATAIRE DF +CONTRAT date contrat ! primary_key True +CONTRAT salaire horaire contrat normal_attribute False +PROFESSEUR num prof ! primary_key True +PROFESSEUR nom prof normal_attribute False +PROFESSEUR prénom prof normal_attribute False +PROFESSEUR téléphone prof normal_attribute False +SALARIÉ num prof ! parent_primary_key True PROFESSEUR PROFESSEUR XT +SALARIÉ date embauche salarié normal_attribute False +SALARIÉ échelon salarié normal_attribute False +SALARIÉ salaire salarié normal_attribute False +VACATAIRE num prof ! parent_primary_key True PROFESSEUR PROFESSEUR XT +VACATAIRE statut vacataire normal_attribute False diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_dependencies.gv b/test/zoo/inheritance_weak/mld/strong_child_0_dependencies.gv new file mode 100644 index 00000000..e5b59860 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_dependencies.gv @@ -0,0 +1,6 @@ +digraph { + node [shape=box] + "VACATAIRE" -> "CONTRAT" + "PROFESSEUR" -> "SALARIÉ" + "PROFESSEUR" -> "VACATAIRE" +} diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_dependencies.svg b/test/zoo/inheritance_weak/mld/strong_child_0_dependencies.svg new file mode 100644 index 00000000..49b94b49 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_dependencies.svg @@ -0,0 +1,54 @@ + + + + + + + + + +VACATAIRE + +VACATAIRE + + + +CONTRAT + +CONTRAT + + + +VACATAIRE->CONTRAT + + + + + +PROFESSEUR + +PROFESSEUR + + + +PROFESSEUR->VACATAIRE + + + + + +SALARIÉ + +SALARIÉ + + + +PROFESSEUR->SALARIÉ + + + + + diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_mld.html b/test/zoo/inheritance_weak/mld/strong_child_0_mld.html new file mode 100644 index 00000000..6a90a0e0 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_mld.html @@ -0,0 +1,72 @@ + + + + + + + +

Conversion en relationnel

Générée par Mocodo

+
+
MCD inheritance_weak
+
+
+
CONTRAT ( + #num prof, + date contrat, + salaire horaire contrat + ) +
    +
  • Le champ num prof fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité VACATAIRE pour renforcer l'identifiant.
  • +
  • Le champ date contrat fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité CONTRAT.
  • +
  • Le champ salaire horaire contrat était déjà un simple attribut de l'entité CONTRAT.
  • +
+
+ +
+
PROFESSEUR ( + num prof, + nom prof, + prénom prof, + téléphone prof + ) +
    +
  • Le champ num prof constitue la clé primaire de la table. C'était déjà un identifiant de l'entité PROFESSEUR.
  • +
  • Les champs nom prof, prénom prof et téléphone prof étaient déjà de simples attributs de l'entité PROFESSEUR.
  • +
+
+ +
+
SALARIÉ ( + #num prof, + date embauche salarié, + échelon salarié, + salaire salarié + ) +
    +
  • Le champ num prof constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère PROFESSEUR.
  • +
  • Les champs date embauche salarié, échelon salarié et salaire salarié étaient déjà de simples attributs de l'entité SALARIÉ.
  • +
+
+ +
+
VACATAIRE ( + #num prof, + statut vacataire + ) +
    +
  • Le champ num prof constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère PROFESSEUR.
  • +
  • Le champ statut vacataire était déjà un simple attribut de l'entité VACATAIRE.
  • +
+
+ +
+
+ + diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_mld.mcd b/test/zoo/inheritance_weak/mld/strong_child_0_mld.mcd new file mode 100644 index 00000000..ce43dd80 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_mld.mcd @@ -0,0 +1,16 @@ +%%mocodo +::: +VACATAIRE: #num prof > PROFESSEUR > num prof, statut vacataire +::: + + +: +CONTRAT: #num prof > VACATAIRE > num prof, _date contrat, salaire horaire contrat +::: +SALARIÉ: #num prof > PROFESSEUR > num prof, date embauche salarié, échelon salarié, salaire salarié +: + + +::: +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof +::: diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_mld.md b/test/zoo/inheritance_weak/mld/strong_child_0_mld.md new file mode 100644 index 00000000..471e7d48 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_mld.md @@ -0,0 +1,16 @@ +- **CONTRAT** (_#num prof_, date contrat, salaire horaire contrat) + - Le champ _num prof_ fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité _VACATAIRE_ pour renforcer l'identifiant. + - Le champ _date contrat_ fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité _CONTRAT_. + - Le champ _salaire horaire contrat_ était déjà un simple attribut de l'entité _CONTRAT_. + +- **PROFESSEUR** (num prof, nom prof, prénom prof, téléphone prof) + - Le champ _num prof_ constitue la clé primaire de la table. C'était déjà un identifiant de l'entité _PROFESSEUR_. + - Les champs _nom prof_, _prénom prof_ et _téléphone prof_ étaient déjà de simples attributs de l'entité _PROFESSEUR_. + +- **SALARIÉ** (_#num prof_, date embauche salarié, échelon salarié, salaire salarié) + - Le champ _num prof_ constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère _PROFESSEUR_. + - Les champs _date embauche salarié_, _échelon salarié_ et _salaire salarié_ étaient déjà de simples attributs de l'entité _SALARIÉ_. + +- **VACATAIRE** (_#num prof_, statut vacataire) + - Le champ _num prof_ constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère _PROFESSEUR_. + - Le champ _statut vacataire_ était déjà un simple attribut de l'entité _VACATAIRE_. diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_mld.svg b/test/zoo/inheritance_weak/mld/strong_child_0_mld.svg new file mode 100644 index 00000000..2ac05e3f --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_mld.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + VACATAIRE + #num prof + + statut vacataire + + + + + + + + + + + CONTRAT + #num prof + + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + #num prof + + date embauche salarié + échelon salarié + salaire salarié + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_mld.tex b/test/zoo/inheritance_weak/mld/strong_child_0_mld.tex new file mode 100644 index 00000000..e3d7f77d --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_mld.tex @@ -0,0 +1,46 @@ +\documentclass[a4paper]{article} +\usepackage[normalem]{ulem} +\usepackage[T1]{fontenc} +\usepackage[french]{babel} +\frenchsetup{StandardLayout=true} + +\newcommand{\relat}[1]{\textsc{#1}} +\newcommand{\attr}[1]{#1} +\newcommand{\prim}[1]{\uline{#1}} +\newcommand{\foreign}[1]{\#\textsl{#1}} + +\title{Conversion en relationnel\\du MCD \emph{inheritance\_weak}} +\author{\emph{Généré par Mocodo}} + +\begin{document} +\maketitle + +\begin{itemize} + \item \relat{CONTRAT} (\foreign{\prim{num prof}}, \prim{date contrat}, \attr{salaire horaire contrat}) + \begin{itemize} + \item Le champ \emph{num prof} fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité \emph{VACATAIRE} pour renforcer l'identifiant. + \item Le champ \emph{date contrat} fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{CONTRAT}. + \item Le champ \emph{salaire horaire contrat} était déjà un simple attribut de l'entité \emph{CONTRAT}. + \end{itemize} + + \item \relat{PROFESSEUR} (\prim{num prof}, \attr{nom prof}, \attr{prénom prof}, \attr{téléphone prof}) + \begin{itemize} + \item Le champ \emph{num prof} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{PROFESSEUR}. + \item Les champs \emph{nom prof}, \emph{prénom prof} et \emph{téléphone prof} étaient déjà de simples attributs de l'entité \emph{PROFESSEUR}. + \end{itemize} + + \item \relat{SALARIÉ} (\foreign{\prim{num prof}}, \attr{date embauche salarié}, \attr{échelon salarié}, \attr{salaire salarié}) + \begin{itemize} + \item Le champ \emph{num prof} constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère \emph{PROFESSEUR}. + \item Les champs \emph{date embauche salarié}, \emph{échelon salarié} et \emph{salaire salarié} étaient déjà de simples attributs de l'entité \emph{SALARIÉ}. + \end{itemize} + + \item \relat{VACATAIRE} (\foreign{\prim{num prof}}, \attr{statut vacataire}) + \begin{itemize} + \item Le champ \emph{num prof} constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère \emph{PROFESSEUR}. + \item Le champ \emph{statut vacataire} était déjà un simple attribut de l'entité \emph{VACATAIRE}. + \end{itemize} + +\end{itemize} + +\end{document} diff --git a/test/zoo/inheritance_weak/mld/strong_child_0_mld.txt b/test/zoo/inheritance_weak/mld/strong_child_0_mld.txt new file mode 100644 index 00000000..6f63705a --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_0_mld.txt @@ -0,0 +1,16 @@ +- CONTRAT (_#num prof_, _date contrat_, salaire horaire contrat) + - Le champ « num prof » fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité « VACATAIRE » pour renforcer l'identifiant. + - Le champ « date contrat » fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité « CONTRAT ». + - Le champ « salaire horaire contrat » était déjà un simple attribut de l'entité « CONTRAT ». + +- PROFESSEUR (_num prof_, nom prof, prénom prof, téléphone prof) + - Le champ « num prof » constitue la clé primaire de la table. C'était déjà un identifiant de l'entité « PROFESSEUR ». + - Les champs « nom prof », « prénom prof » et « téléphone prof » étaient déjà de simples attributs de l'entité « PROFESSEUR ». + +- SALARIÉ (_#num prof_, date embauche salarié, échelon salarié, salaire salarié) + - Le champ « num prof » constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère « PROFESSEUR ». + - Les champs « date embauche salarié », « échelon salarié » et « salaire salarié » étaient déjà de simples attributs de l'entité « SALARIÉ ». + +- VACATAIRE (_#num prof_, statut vacataire) + - Le champ « num prof » constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère « PROFESSEUR ». + - Le champ « statut vacataire » était déjà un simple attribut de l'entité « VACATAIRE ». diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_debug.tsv b/test/zoo/inheritance_weak/mld/strong_child_1_debug.tsv new file mode 100644 index 00000000..5511db45 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_debug.tsv @@ -0,0 +1,12 @@ +this relation name attribute optionality unicities nature is primary adjacent source outer source association name datatype leg note +CONTRAT num prof ! strengthening_primary_foreign_key True VACATAIRE PROFESSEUR DF +CONTRAT date contrat ! primary_key True +CONTRAT salaire horaire contrat normal_attribute False +PROFESSEUR num prof ! primary_key True +PROFESSEUR nom prof normal_attribute False +PROFESSEUR prénom prof normal_attribute False +PROFESSEUR téléphone prof normal_attribute False +PROFESSEUR statut vacataire ? deleted_child_attribute False VACATAIRE XT +PROFESSEUR date embauche salarié ? deleted_child_attribute False SALARIÉ XT +PROFESSEUR échelon salarié ? deleted_child_attribute False SALARIÉ XT +PROFESSEUR salaire salarié ? deleted_child_attribute False SALARIÉ XT diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_dependencies.gv b/test/zoo/inheritance_weak/mld/strong_child_1_dependencies.gv new file mode 100644 index 00000000..a9384c6d --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_dependencies.gv @@ -0,0 +1,4 @@ +digraph { + node [shape=box] + "PROFESSEUR" -> "CONTRAT" +} diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_dependencies.svg b/test/zoo/inheritance_weak/mld/strong_child_1_dependencies.svg new file mode 100644 index 00000000..e7bdf63f --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_dependencies.svg @@ -0,0 +1,30 @@ + + + + + + + + + +PROFESSEUR + +PROFESSEUR + + + +CONTRAT + +CONTRAT + + + +PROFESSEUR->CONTRAT + + + + + diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_mld.html b/test/zoo/inheritance_weak/mld/strong_child_1_mld.html new file mode 100644 index 00000000..06682b2a --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_mld.html @@ -0,0 +1,56 @@ + + + + + + + +

Conversion en relationnel

Générée par Mocodo

+
+
MCD inheritance_weak
+
+
+
CONTRAT ( + #num prof, + date contrat, + salaire horaire contrat + ) +
    +
  • Le champ num prof fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité PROFESSEUR pour renforcer l'identifiant.
  • +
  • Le champ date contrat fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité CONTRAT.
  • +
  • Le champ salaire horaire contrat était déjà un simple attribut de l'entité CONTRAT.
  • +
+
+ +
+
PROFESSEUR ( + num prof, + nom prof, + prénom prof, + téléphone prof, + statut vacataire?, + date embauche salarié?, + échelon salarié?, + salaire salarié? + ) +
    +
  • Le champ num prof constitue la clé primaire de la table. C'était déjà un identifiant de l'entité PROFESSEUR.
  • +
  • Les champs nom prof, prénom prof et téléphone prof étaient déjà de simples attributs de l'entité PROFESSEUR.
  • +
  • Le champ à saisie facultative statut vacataire a migré à partir de l'entité-fille VACATAIRE (supprimée).
  • +
  • Le champ à saisie facultative date embauche salarié a migré à partir de l'entité-fille SALARIÉ (supprimée).
  • +
  • Le champ à saisie facultative échelon salarié a migré à partir de l'entité-fille SALARIÉ (supprimée).
  • +
  • Le champ à saisie facultative salaire salarié a migré à partir de l'entité-fille SALARIÉ (supprimée).
  • +
+
+ +
+
+ + diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_mld.mcd b/test/zoo/inheritance_weak/mld/strong_child_1_mld.mcd new file mode 100644 index 00000000..f73b91d8 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_mld.mcd @@ -0,0 +1,8 @@ +: +CONTRAT: #num prof > PROFESSEUR > num prof, _date contrat, salaire horaire contrat +::: + + +::: +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof, statut vacataire, date embauche salarié, échelon salarié, salaire salarié +: diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_mld.md b/test/zoo/inheritance_weak/mld/strong_child_1_mld.md new file mode 100644 index 00000000..02be5926 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_mld.md @@ -0,0 +1,12 @@ +- **CONTRAT** (_#num prof_, date contrat, salaire horaire contrat) + - Le champ _num prof_ fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité _PROFESSEUR_ pour renforcer l'identifiant. + - Le champ _date contrat_ fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité _CONTRAT_. + - Le champ _salaire horaire contrat_ était déjà un simple attribut de l'entité _CONTRAT_. + +- **PROFESSEUR** (num prof, nom prof, prénom prof, téléphone prof, statut vacataire?, date embauche salarié?, échelon salarié?, salaire salarié?) + - Le champ _num prof_ constitue la clé primaire de la table. C'était déjà un identifiant de l'entité _PROFESSEUR_. + - Les champs _nom prof_, _prénom prof_ et _téléphone prof_ étaient déjà de simples attributs de l'entité _PROFESSEUR_. + - Le champ à saisie facultative _statut vacataire_ a migré à partir de l'entité-fille _VACATAIRE_ (supprimée). + - Le champ à saisie facultative _date embauche salarié_ a migré à partir de l'entité-fille _SALARIÉ_ (supprimée). + - Le champ à saisie facultative _échelon salarié_ a migré à partir de l'entité-fille _SALARIÉ_ (supprimée). + - Le champ à saisie facultative _salaire salarié_ a migré à partir de l'entité-fille _SALARIÉ_ (supprimée). diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_mld.svg b/test/zoo/inheritance_weak/mld/strong_child_1_mld.svg new file mode 100644 index 00000000..ded00aa8 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_mld.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + CONTRAT + #num prof + + date contrat + + salaire horaire contrat + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + statut vacataire + date embauche salarié + échelon salarié + salaire salarié + + + + + + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_mld.tex b/test/zoo/inheritance_weak/mld/strong_child_1_mld.tex new file mode 100644 index 00000000..5d88412c --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_mld.tex @@ -0,0 +1,38 @@ +\documentclass[a4paper]{article} +\usepackage[normalem]{ulem} +\usepackage[T1]{fontenc} +\usepackage[french]{babel} +\frenchsetup{StandardLayout=true} + +\newcommand{\relat}[1]{\textsc{#1}} +\newcommand{\attr}[1]{#1} +\newcommand{\prim}[1]{\uline{#1}} +\newcommand{\foreign}[1]{\#\textsl{#1}} + +\title{Conversion en relationnel\\du MCD \emph{inheritance\_weak}} +\author{\emph{Généré par Mocodo}} + +\begin{document} +\maketitle + +\begin{itemize} + \item \relat{CONTRAT} (\foreign{\prim{num prof}}, \prim{date contrat}, \attr{salaire horaire contrat}) + \begin{itemize} + \item Le champ \emph{num prof} fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité \emph{PROFESSEUR} pour renforcer l'identifiant. + \item Le champ \emph{date contrat} fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{CONTRAT}. + \item Le champ \emph{salaire horaire contrat} était déjà un simple attribut de l'entité \emph{CONTRAT}. + \end{itemize} + + \item \relat{PROFESSEUR} (\prim{num prof}, \attr{nom prof}, \attr{prénom prof}, \attr{téléphone prof}, \attr{statut vacataire?}, \attr{date embauche salarié?}, \attr{échelon salarié?}, \attr{salaire salarié?}) + \begin{itemize} + \item Le champ \emph{num prof} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{PROFESSEUR}. + \item Les champs \emph{nom prof}, \emph{prénom prof} et \emph{téléphone prof} étaient déjà de simples attributs de l'entité \emph{PROFESSEUR}. + \item Le champ à saisie facultative \emph{statut vacataire} a migré à partir de l'entité-fille \emph{VACATAIRE} (supprimée). + \item Le champ à saisie facultative \emph{date embauche salarié} a migré à partir de l'entité-fille \emph{SALARIÉ} (supprimée). + \item Le champ à saisie facultative \emph{échelon salarié} a migré à partir de l'entité-fille \emph{SALARIÉ} (supprimée). + \item Le champ à saisie facultative \emph{salaire salarié} a migré à partir de l'entité-fille \emph{SALARIÉ} (supprimée). + \end{itemize} + +\end{itemize} + +\end{document} diff --git a/test/zoo/inheritance_weak/mld/strong_child_1_mld.txt b/test/zoo/inheritance_weak/mld/strong_child_1_mld.txt new file mode 100644 index 00000000..ddded48b --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_1_mld.txt @@ -0,0 +1,12 @@ +- CONTRAT (_#num prof_, _date contrat_, salaire horaire contrat) + - Le champ « num prof » fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité « PROFESSEUR » pour renforcer l'identifiant. + - Le champ « date contrat » fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité « CONTRAT ». + - Le champ « salaire horaire contrat » était déjà un simple attribut de l'entité « CONTRAT ». + +- PROFESSEUR (_num prof_, nom prof, prénom prof, téléphone prof, statut vacataire?, date embauche salarié?, échelon salarié?, salaire salarié?) + - Le champ « num prof » constitue la clé primaire de la table. C'était déjà un identifiant de l'entité « PROFESSEUR ». + - Les champs « nom prof », « prénom prof » et « téléphone prof » étaient déjà de simples attributs de l'entité « PROFESSEUR ». + - Le champ à saisie facultative « statut vacataire » a migré à partir de l'entité-fille « VACATAIRE » (supprimée). + - Le champ à saisie facultative « date embauche salarié » a migré à partir de l'entité-fille « SALARIÉ » (supprimée). + - Le champ à saisie facultative « échelon salarié » a migré à partir de l'entité-fille « SALARIÉ » (supprimée). + - Le champ à saisie facultative « salaire salarié » a migré à partir de l'entité-fille « SALARIÉ » (supprimée). diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_debug.tsv b/test/zoo/inheritance_weak/mld/strong_child_2_debug.tsv new file mode 100644 index 00000000..7c4a1a76 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_debug.tsv @@ -0,0 +1,16 @@ +this relation name attribute optionality unicities nature is primary adjacent source outer source association name datatype leg note +CONTRAT num prof ! strengthening_primary_foreign_key True VACATAIRE VACATAIRE DF +CONTRAT date contrat ! primary_key True +CONTRAT salaire horaire contrat normal_attribute False +SALARIÉ num prof ! deleted_parent_primary_key True PROFESSEUR PROFESSEUR XT +SALARIÉ nom prof deleted_parent_attribute False PROFESSEUR XT +SALARIÉ prénom prof deleted_parent_attribute False PROFESSEUR XT +SALARIÉ téléphone prof deleted_parent_attribute False PROFESSEUR XT +SALARIÉ date embauche salarié normal_attribute False +SALARIÉ échelon salarié normal_attribute False +SALARIÉ salaire salarié normal_attribute False +VACATAIRE num prof ! deleted_parent_primary_key True PROFESSEUR PROFESSEUR XT +VACATAIRE nom prof deleted_parent_attribute False PROFESSEUR XT +VACATAIRE prénom prof deleted_parent_attribute False PROFESSEUR XT +VACATAIRE téléphone prof deleted_parent_attribute False PROFESSEUR XT +VACATAIRE statut vacataire normal_attribute False diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_dependencies.gv b/test/zoo/inheritance_weak/mld/strong_child_2_dependencies.gv new file mode 100644 index 00000000..ea92ec3c --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_dependencies.gv @@ -0,0 +1,4 @@ +digraph { + node [shape=box] + "VACATAIRE" -> "CONTRAT" +} diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_dependencies.svg b/test/zoo/inheritance_weak/mld/strong_child_2_dependencies.svg new file mode 100644 index 00000000..612dd4f1 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_dependencies.svg @@ -0,0 +1,30 @@ + + + + + + + + + +VACATAIRE + +VACATAIRE + + + +CONTRAT + +CONTRAT + + + +VACATAIRE->CONTRAT + + + + + diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_mld.html b/test/zoo/inheritance_weak/mld/strong_child_2_mld.html new file mode 100644 index 00000000..4919cf8a --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_mld.html @@ -0,0 +1,71 @@ + + + + + + + +

Conversion en relationnel

Générée par Mocodo

+
+
MCD inheritance_weak
+
+
+
CONTRAT ( + #num prof, + date contrat, + salaire horaire contrat + ) +
    +
  • Le champ num prof fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité VACATAIRE pour renforcer l'identifiant.
  • +
  • Le champ date contrat fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité CONTRAT.
  • +
  • Le champ salaire horaire contrat était déjà un simple attribut de l'entité CONTRAT.
  • +
+
+ +
+
SALARIÉ ( + num prof, + nom prof, + prénom prof, + téléphone prof, + date embauche salarié, + échelon salarié, + salaire salarié + ) +
    +
  • Le champ num prof constitue la clé primaire de la table. Il était clé primaire de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Le champ nom prof est un simple attribut. Il était simple attribut de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Le champ prénom prof est un simple attribut. Il était simple attribut de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Le champ téléphone prof est un simple attribut. Il était simple attribut de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Les champs date embauche salarié, échelon salarié et salaire salarié étaient déjà de simples attributs de l'entité SALARIÉ.
  • +
+
+ +
+
VACATAIRE ( + num prof, + nom prof, + prénom prof, + téléphone prof, + statut vacataire + ) +
    +
  • Le champ num prof constitue la clé primaire de la table. Il était clé primaire de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Le champ nom prof est un simple attribut. Il était simple attribut de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Le champ prénom prof est un simple attribut. Il était simple attribut de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Le champ téléphone prof est un simple attribut. Il était simple attribut de l'entité-mère PROFESSEUR (supprimée).
  • +
  • Le champ statut vacataire était déjà un simple attribut de l'entité VACATAIRE.
  • +
+
+ +
+
+ + diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_mld.mcd b/test/zoo/inheritance_weak/mld/strong_child_2_mld.mcd new file mode 100644 index 00000000..8d118bb6 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_mld.mcd @@ -0,0 +1,11 @@ +%%mocodo +::: +VACATAIRE: num prof, nom prof, prénom prof, téléphone prof, statut vacataire +::: + + +: +CONTRAT: #num prof > VACATAIRE > num prof, _date contrat, salaire horaire contrat +::: +SALARIÉ: num prof, nom prof, prénom prof, téléphone prof, date embauche salarié, échelon salarié, salaire salarié +: diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_mld.md b/test/zoo/inheritance_weak/mld/strong_child_2_mld.md new file mode 100644 index 00000000..d652f608 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_mld.md @@ -0,0 +1,18 @@ +- **CONTRAT** (_#num prof_, date contrat, salaire horaire contrat) + - Le champ _num prof_ fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité _VACATAIRE_ pour renforcer l'identifiant. + - Le champ _date contrat_ fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité _CONTRAT_. + - Le champ _salaire horaire contrat_ était déjà un simple attribut de l'entité _CONTRAT_. + +- **SALARIÉ** (num prof, nom prof, prénom prof, téléphone prof, date embauche salarié, échelon salarié, salaire salarié) + - Le champ _num prof_ constitue la clé primaire de la table. Il était clé primaire de l'entité-mère _PROFESSEUR_ (supprimée). + - Le champ _nom prof_ est un simple attribut. Il était simple attribut de l'entité-mère _PROFESSEUR_ (supprimée). + - Le champ _prénom prof_ est un simple attribut. Il était simple attribut de l'entité-mère _PROFESSEUR_ (supprimée). + - Le champ _téléphone prof_ est un simple attribut. Il était simple attribut de l'entité-mère _PROFESSEUR_ (supprimée). + - Les champs _date embauche salarié_, _échelon salarié_ et _salaire salarié_ étaient déjà de simples attributs de l'entité _SALARIÉ_. + +- **VACATAIRE** (num prof, nom prof, prénom prof, téléphone prof, statut vacataire) + - Le champ _num prof_ constitue la clé primaire de la table. Il était clé primaire de l'entité-mère _PROFESSEUR_ (supprimée). + - Le champ _nom prof_ est un simple attribut. Il était simple attribut de l'entité-mère _PROFESSEUR_ (supprimée). + - Le champ _prénom prof_ est un simple attribut. Il était simple attribut de l'entité-mère _PROFESSEUR_ (supprimée). + - Le champ _téléphone prof_ est un simple attribut. Il était simple attribut de l'entité-mère _PROFESSEUR_ (supprimée). + - Le champ _statut vacataire_ était déjà un simple attribut de l'entité _VACATAIRE_. diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_mld.svg b/test/zoo/inheritance_weak/mld/strong_child_2_mld.svg new file mode 100644 index 00000000..65d37dfb --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_mld.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + VACATAIRE + num prof + + nom prof + prénom prof + téléphone prof + statut vacataire + + + + + + + + + + + CONTRAT + #num prof + + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + num prof + + nom prof + prénom prof + téléphone prof + date embauche salarié + échelon salarié + salaire salarié + + + + + + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_mld.tex b/test/zoo/inheritance_weak/mld/strong_child_2_mld.tex new file mode 100644 index 00000000..9038a203 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_mld.tex @@ -0,0 +1,46 @@ +\documentclass[a4paper]{article} +\usepackage[normalem]{ulem} +\usepackage[T1]{fontenc} +\usepackage[french]{babel} +\frenchsetup{StandardLayout=true} + +\newcommand{\relat}[1]{\textsc{#1}} +\newcommand{\attr}[1]{#1} +\newcommand{\prim}[1]{\uline{#1}} +\newcommand{\foreign}[1]{\#\textsl{#1}} + +\title{Conversion en relationnel\\du MCD \emph{inheritance\_weak}} +\author{\emph{Généré par Mocodo}} + +\begin{document} +\maketitle + +\begin{itemize} + \item \relat{CONTRAT} (\foreign{\prim{num prof}}, \prim{date contrat}, \attr{salaire horaire contrat}) + \begin{itemize} + \item Le champ \emph{num prof} fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité \emph{VACATAIRE} pour renforcer l'identifiant. + \item Le champ \emph{date contrat} fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{CONTRAT}. + \item Le champ \emph{salaire horaire contrat} était déjà un simple attribut de l'entité \emph{CONTRAT}. + \end{itemize} + + \item \relat{SALARIÉ} (\prim{num prof}, \attr{nom prof}, \attr{prénom prof}, \attr{téléphone prof}, \attr{date embauche salarié}, \attr{échelon salarié}, \attr{salaire salarié}) + \begin{itemize} + \item Le champ \emph{num prof} constitue la clé primaire de la table. Il était clé primaire de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Le champ \emph{nom prof} est un simple attribut. Il était simple attribut de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Le champ \emph{prénom prof} est un simple attribut. Il était simple attribut de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Le champ \emph{téléphone prof} est un simple attribut. Il était simple attribut de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Les champs \emph{date embauche salarié}, \emph{échelon salarié} et \emph{salaire salarié} étaient déjà de simples attributs de l'entité \emph{SALARIÉ}. + \end{itemize} + + \item \relat{VACATAIRE} (\prim{num prof}, \attr{nom prof}, \attr{prénom prof}, \attr{téléphone prof}, \attr{statut vacataire}) + \begin{itemize} + \item Le champ \emph{num prof} constitue la clé primaire de la table. Il était clé primaire de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Le champ \emph{nom prof} est un simple attribut. Il était simple attribut de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Le champ \emph{prénom prof} est un simple attribut. Il était simple attribut de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Le champ \emph{téléphone prof} est un simple attribut. Il était simple attribut de l'entité-mère \emph{PROFESSEUR} (supprimée). + \item Le champ \emph{statut vacataire} était déjà un simple attribut de l'entité \emph{VACATAIRE}. + \end{itemize} + +\end{itemize} + +\end{document} diff --git a/test/zoo/inheritance_weak/mld/strong_child_2_mld.txt b/test/zoo/inheritance_weak/mld/strong_child_2_mld.txt new file mode 100644 index 00000000..bdf98af4 --- /dev/null +++ b/test/zoo/inheritance_weak/mld/strong_child_2_mld.txt @@ -0,0 +1,18 @@ +- CONTRAT (_#num prof_, _date contrat_, salaire horaire contrat) + - Le champ « num prof » fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité « VACATAIRE » pour renforcer l'identifiant. + - Le champ « date contrat » fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité « CONTRAT ». + - Le champ « salaire horaire contrat » était déjà un simple attribut de l'entité « CONTRAT ». + +- SALARIÉ (_num prof_, nom prof, prénom prof, téléphone prof, date embauche salarié, échelon salarié, salaire salarié) + - Le champ « num prof » constitue la clé primaire de la table. Il était clé primaire de l'entité-mère « PROFESSEUR » (supprimée). + - Le champ « nom prof » est un simple attribut. Il était simple attribut de l'entité-mère « PROFESSEUR » (supprimée). + - Le champ « prénom prof » est un simple attribut. Il était simple attribut de l'entité-mère « PROFESSEUR » (supprimée). + - Le champ « téléphone prof » est un simple attribut. Il était simple attribut de l'entité-mère « PROFESSEUR » (supprimée). + - Les champs « date embauche salarié », « échelon salarié » et « salaire salarié » étaient déjà de simples attributs de l'entité « SALARIÉ ». + +- VACATAIRE (_num prof_, nom prof, prénom prof, téléphone prof, statut vacataire) + - Le champ « num prof » constitue la clé primaire de la table. Il était clé primaire de l'entité-mère « PROFESSEUR » (supprimée). + - Le champ « nom prof » est un simple attribut. Il était simple attribut de l'entité-mère « PROFESSEUR » (supprimée). + - Le champ « prénom prof » est un simple attribut. Il était simple attribut de l'entité-mère « PROFESSEUR » (supprimée). + - Le champ « téléphone prof » est un simple attribut. Il était simple attribut de l'entité-mère « PROFESSEUR » (supprimée). + - Le champ « statut vacataire » était déjà un simple attribut de l'entité « VACATAIRE ». diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.mcd new file mode 100644 index 00000000..e5f32a3a --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Class table inheritance: all entities are preserved + +DF, _11 CONTRAT, 1N> VACATAIRE +VACATAIRE: statut vacataire + +CONTRAT: date contrat, salaire horaire contrat +/XT\ PROFESSEUR -> VACATAIRE, SALARIÉ +SALARIÉ: date embauche salarié, échelon salarié, salaire salarié + +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.svg b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.svg new file mode 100644 index 00000000..cd0a2584 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_create_df_arrows=across.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + XT + + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + VACATAIRE + statut vacataire + + + + + + + + + + + CONTRAT + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + date embauche salarié + échelon salarié + salaire salarié + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drain.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drain.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drain.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.mcd new file mode 100644 index 00000000..123c7a3f --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Class table inheritance: all entities are preserved + +DF, _11 ENTITÉ 2_, 1N ENTITÉ 1_ +ENTITÉ 1_: at 1 1 + +ENTITÉ 2_: at 2 1, at 2 2 +/XT\ ENTITÉ 4_ -> ENTITÉ 1_, ENTITÉ 3_ +ENTITÉ 3_: at 3 1, at 3 2, at 3 3 + +ENTITÉ 4_: at 4 1, at 4 2, at 4 3, at 4 4 diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.svg b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.svg new file mode 100644 index 00000000..7b848a02 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_drown.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + XT + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + ENTITÉ 1 + at 1 1 + + + + + + + + + + + ENTITÉ 2 + at 2 1 + + at 2 2 + + + + + + + + + + + ENTITÉ 3 + at 3 1 + at 3 2 + at 3 3 + + + + + + + + + + + ENTITÉ 4 + at 4 1 + + at 4 2 + at 4 3 + at 4 4 + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.5.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=2.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_explode_arity=3.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_split.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_split.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_0_rw_split.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.mcd new file mode 100644 index 00000000..210e8ad6 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Single table inheritance: children are merged into the parent table + +DF, _11 CONTRAT, 1N> VACATAIRE +VACATAIRE: statut vacataire + +CONTRAT: date contrat, salaire horaire contrat +/XT\ PROFESSEUR <- VACATAIRE, SALARIÉ +SALARIÉ: date embauche salarié, échelon salarié, salaire salarié + +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.svg b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.svg new file mode 100644 index 00000000..c52c66d1 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_create_df_arrows=across.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + XT + + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + VACATAIRE + statut vacataire + + + + + + + + + + + CONTRAT + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + date embauche salarié + échelon salarié + salaire salarié + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drain.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drain.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drain.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.mcd new file mode 100644 index 00000000..0624f243 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Single table inheritance: children are merged into the parent table + +DF, _11 ENTITÉ 2_, 1N ENTITÉ 1_ +ENTITÉ 1_: at 1 1 + +ENTITÉ 2_: at 2 1, at 2 2 +/XT\ ENTITÉ 4_ <- ENTITÉ 1_, ENTITÉ 3_ +ENTITÉ 3_: at 3 1, at 3 2, at 3 3 + +ENTITÉ 4_: at 4 1, at 4 2, at 4 3, at 4 4 diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.svg b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.svg new file mode 100644 index 00000000..e28fc063 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_drown.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + XT + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + ENTITÉ 1 + at 1 1 + + + + + + + + + + + ENTITÉ 2 + at 2 1 + + at 2 2 + + + + + + + + + + + ENTITÉ 3 + at 3 1 + at 3 2 + at 3 3 + + + + + + + + + + + ENTITÉ 4 + at 4 1 + + at 4 2 + at 4 3 + at 4 4 + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.5.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=2.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_explode_arity=3.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_split.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_split.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_1_rw_split.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.mcd new file mode 100644 index 00000000..10b9f111 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Concrete table inheritance: parent disappears + +DF, _11 CONTRAT, 1N> VACATAIRE +VACATAIRE: statut vacataire + +CONTRAT: date contrat, salaire horaire contrat +/XT\ PROFESSEUR => VACATAIRE, SALARIÉ +SALARIÉ: date embauche salarié, échelon salarié, salaire salarié + +PROFESSEUR: num prof, nom prof, prénom prof, téléphone prof diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.svg b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.svg new file mode 100644 index 00000000..4e03309d --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_create_df_arrows=across.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + XT + + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + VACATAIRE + statut vacataire + + + + + + + + + + + CONTRAT + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + date embauche salarié + échelon salarié + salaire salarié + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drain.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drain.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drain.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.mcd new file mode 100644 index 00000000..022658f2 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.mcd @@ -0,0 +1,11 @@ +% https://github.com/laowantong/mocodo/issues/118 +% Concrete table inheritance: parent disappears + +DF, _11 ENTITÉ 2_, 1N ENTITÉ 1_ +ENTITÉ 1_: at 1 1 + +ENTITÉ 2_: at 2 1, at 2 2 +/XT\ ENTITÉ 4_ => ENTITÉ 1_, ENTITÉ 3_ +ENTITÉ 3_: at 3 1, at 3 2, at 3 3 + +ENTITÉ 4_: at 4 1, at 4 2, at 4 3, at 4 4 diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.svg b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.svg new file mode 100644 index 00000000..ebc6c434 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_drown.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + XT + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + ENTITÉ 1 + at 1 1 + + + + + + + + + + + ENTITÉ 2 + at 2 1 + + at 2 2 + + + + + + + + + + + ENTITÉ 3 + at 3 1 + at 3 2 + at 3 3 + + + + + + + + + + + ENTITÉ 4 + at 4 1 + + at 4 2 + at 4 3 + at 4 4 + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.5.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=2.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3,weak.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3,weak.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3,weak.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_explode_arity=3.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_split.mcd b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_split.mcd new file mode 100644 index 00000000..b5b10f46 --- /dev/null +++ b/test/zoo/inheritance_weak/rewritten/strong_child_2_rw_split.mcd @@ -0,0 +1 @@ +% same as the source file diff --git a/test/zoo/inheritance_weak/strong_child_0.svg b/test/zoo/inheritance_weak/strong_child_0.svg new file mode 100644 index 00000000..5ca271bb --- /dev/null +++ b/test/zoo/inheritance_weak/strong_child_0.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + XT + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + VACATAIRE + statut vacataire + + + + + + + + + + + CONTRAT + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + date embauche salarié + échelon salarié + salaire salarié + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/strong_child_1.svg b/test/zoo/inheritance_weak/strong_child_1.svg new file mode 100644 index 00000000..d6bed433 --- /dev/null +++ b/test/zoo/inheritance_weak/strong_child_1.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + XT + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + VACATAIRE + statut vacataire + + + + + + + + + + + CONTRAT + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + date embauche salarié + échelon salarié + salaire salarié + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + + \ No newline at end of file diff --git a/test/zoo/inheritance_weak/strong_child_2.svg b/test/zoo/inheritance_weak/strong_child_2.svg new file mode 100644 index 00000000..a8b6d32d --- /dev/null +++ b/test/zoo/inheritance_weak/strong_child_2.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + XT + + + + + + + + + + DF + + 1,1 + + 1,N + + + + + + + + + + + VACATAIRE + statut vacataire + + + + + + + + + + + CONTRAT + date contrat + + salaire horaire contrat + + + + + + + + + + + SALARIÉ + date embauche salarié + échelon salarié + salaire salarié + + + + + + + + + + + PROFESSEUR + num prof + + nom prof + prénom prof + téléphone prof + + \ No newline at end of file