Database Reference
In-Depth Information
Traduction des agrégations (composition)
Le tableau suivant décrit la transformation d'une agrégation de composition. L'association doit
se traduire par deux mécanismes : migration d'une clé étrangère du composite et enrichisse-
ment de la clé primaire du composant.
Tableau 3-5 : Transformation d'un agrégat
Schéma relationnel
Script SQL
ALTER TABLE histo_annee
DROP CONSTRAINT fk_histo_employe;
DROP TABLE employe CASCADE CONSTRAINTS;
DROP TABLE histo_annee CASCADE CONSTRAINTS;
CREATE TABLE employe (
id_emp INTEGER NOT NULL,
nom_emp VARCHAR2(50),
date_embauche DATE,
CONSTRAINT pk_employe PRIMARY KEY (id_emp));
CREATE TABLE histo_annee (
id_emp INTEGER NOT NULL,
annee INTEGER NOT NULL,
indice INTEGER,
salaire NUMBER(7,2),
CONSTRAINT pk_histo_annee
PRIMARY KEY ( id_emp, annee ));
Figure 3-6 . Agrégation à traduire
ALTER TABLE histo_annee
ADD CONSTRAINT fk_histo_employe
FOREIGN KEY (id_emp)
REFERENCES employe (id_emp);
Vérifiez.que.la.clé.primaire.de.la.table.« composant ».est.constituée.en.partie.de.la.clé.primaire.
de.la.table.« composite ».
Traduction des associations plusieurs-à-plusieurs
Le tableau suivant décrit la transformation d'une association plusieurs-à-plusieurs (résultant
d'une classe-association au niveau conceptuel).
 
Search WWH ::




Custom Search