• Solo Great Sale

    Solo Great Sale Powered By Circle Card 2015

  • Solo Great Sale

    Solo Great Sale Powered By Circle Card 2015

  • Oracle Java Magazine

    As Cover of Oracle Java Magazine March/April 2012 issue

  • Launching jDuchess Indonesia

    Gunadarma University 2011

    www.jduchess.or.id

  • Launching jDuchess Indonesia

    Gunadarma University 2011

    www.jduchess.or.id

  • Launching Java 7

    Binus University 2011

  • Eclipse Democamp

    Microsoft Indonesia 2011

  • Oracle Academy

    SMK PGRI 3 Malang 2010

  • Launching JENI 2.0

    ITB Bandung 2012

  • Oracle Academy

    SMK PGRI 3 Malang 2010

  • Java and Android Roadshow

    SMK PGRI 3 Malang 2012

  • Oracle Academy

    SMK PGRI 3 Malang 2010

  • Launching JENI 2.0

    ITB Bandung 2012

  • Oracle Academy

    SMK PGRI 3 Malang 2011

  • Java and Android Roadshow

    SMK Plus Darussalam Kediri 2012

  • Oracle Academy Seminar

    LIKMI Bandung, 2012

  • Oracle Academy Seminar

    Indonesia University, 2012

  • Seminar Android

    Universitas Budi Luhur 2010

  • Java and Android Roadshow

    SMK Hasan Kafrawi Jepara 2012

  • Sosialisasi Kurikulum 2013

    LPMP Surabaya 2013

  • IOSA

    Indonesia Open Source Award 2011

  • Java Training

    SMKN 02 Sukabumi 2010

  • Sosialisasi Kurikulum

    SMKN 01 Tulungagung 2011

  • Sosialisasi Kurikulum 2013

    LPMP Surabaya 2013

Wednesday, April 23, 2014

Posted by Netty Herawaty
| 11:28 PM
EER (Enhanced Entity Relationship) adalah model yang berisikan seluruh konsep ER ditambah dengan konsep superclass, subclass, specialization dan generalization.

Untuk memahami konsep EER ini, saya akan berikan contoh kasus project management atau manajemen proyek di departemen IT. Ada 3 entitas disini, yaitu IT Staff, Project dan TimeFrame. IT Staff berperan sebagai Superclass dengan 3 Subclass yaitu Programmer, Technician dan Documentator. Perhatikan model EER dibawah ini.


Keterangan :

1. Tipe EER yang saya gunakan adalah Spesialization (Spesialisasi), yaitu memecah entity IT Staff menjadi 3 subclass (Programmer, Technician dan Documentator) beserta atributnya.

2. Tipe Constraint pada model EER diatas adalah Disjoint Partial yang dilambangkan dengan simbol d (disjoint) dan garis tunggal.

Mengapa Disjoint Constraint ?

Disjoint karena pada contoh kasus ini sebuah entity hanya bisa menjadi anggota dari salah satu subclass. Artinya tidak memungkinkan seorang programmer merangkap menjadi technician atau documentator.

Partial karena ada entity pada superclass yang bukan merupakan anggota subclass manapun. Artinya masih ada entity lain dibawah entity IT Staff selain Programmer, Technician dan Documentator namun tidak saya sebutkan di model EER diatas.

3. Ada 2 relasi entitas, yaitu relasi many-to-many antara entitas IT Staff dengan entitas Project. Artinya ada beberapa Project yang harus dibagikan ke beberapa IT Staff.

Relasi yang kedua yaitu one-to-many antara entitas Project dengan entitas TimeFrame. Artinya dalam satu project ada beberapa time frame (jangka waktu pengerjaan) yang harus dikerjakan.

Pemetaan (Mapping) EER

IT Staff
Programmer
Technician
Documentator
Project
TimeFrame

Mapping dengan MySQL Workbench

Berikut hasil mapping atau pemetaan EER model diatas yang saya buat dengan MySQL Workbench


MySQL Query

Dari hasil mapping di MySQL Workbench bisa di export menjadi query MySQL seperti berikut ini

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

DROP SCHEMA IF EXISTS `project_management` ;
CREATE SCHEMA IF NOT EXISTS `project_management` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `project_management` ;

-- -----------------------------------------------------
-- Table `project_management`.`itstaff`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`itstaff` (
  `id_staff` INT NOT NULL,
  `name` VARCHAR(45) NOT NULL,
  `grade` VARCHAR(45) NOT NULL,
  `gender` ENUM('M','F') NOT NULL,
  `dob` DATE NULL,
  `email` VARCHAR(45) NOT NULL,
  `mobile_no` INT(15) NULL,
  PRIMARY KEY (`id_staff`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `project_management`.`project`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`project` (
  `id_project` INT NOT NULL AUTO_INCREMENT,
  `project_name` VARCHAR(45) NOT NULL,
  `leader` VARCHAR(45) NOT NULL,
  `status` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`id_project`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `project_management`.`timeframe`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`timeframe` (
  `id_tf` INT NOT NULL AUTO_INCREMENT,
  `tf_name` VARCHAR(45) NOT NULL,
  `start_date` DATE NOT NULL,
  `end_date` DATE NOT NULL,
  `status` VARCHAR(45) NOT NULL,
  `project_id_project` INT NOT NULL,
  PRIMARY KEY (`id_tf`, `project_id_project`),
  INDEX `fk_timeframe_project_idx` (`project_id_project` ASC),
  CONSTRAINT `fk_timeframe_project`
    FOREIGN KEY (`project_id_project`)
    REFERENCES `project_management`.`project` (`id_project`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `project_management`.`programmer`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`programmer` (
  `id_programmer` INT NOT NULL AUTO_INCREMENT,
  `id_staff` INT NOT NULL,
  `prog_language` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`id_programmer`, `id_staff`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `project_management`.`technician`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`technician` (
  `id_technician` INT NOT NULL AUTO_INCREMENT,
  `id_staff` INT NOT NULL,
  `specialty` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`id_technician`, `id_staff`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `project_management`.`documentator`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`documentator` (
  `id_documentator` INT NOT NULL AUTO_INCREMENT,
  `id_staff` INT NOT NULL,
  `project_knowledge` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`id_documentator`, `id_staff`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `project_management`.`it_staff_has_project`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`it_staff_has_project` (
)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `project_management`.`itstaff_has_project`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `project_management`.`itstaff_has_project` (
  `itstaff_id_staff` INT NOT NULL,
  `project_id_project` INT NOT NULL,
  PRIMARY KEY (`itstaff_id_staff`, `project_id_project`),
  INDEX `fk_itstaff_has_project_project1_idx` (`project_id_project` ASC),
  INDEX `fk_itstaff_has_project_itstaff1_idx` (`itstaff_id_staff` ASC),
  CONSTRAINT `fk_itstaff_has_project_itstaff1`
    FOREIGN KEY (`itstaff_id_staff`)
    REFERENCES `project_management`.`itstaff` (`id_staff`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_itstaff_has_project_project1`
    FOREIGN KEY (`project_id_project`)
    REFERENCES `project_management`.`project` (`id_project`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Reactions: