March 27, 200291.3913 R McFadyen1 OR Mapping - Example When we map this structure to a Relational Database, we are creating an object-to-relational mapping.

Slides:



Advertisements
Similar presentations
Relational Database Design Via ER Modelling
Advertisements

On the logic of merging Sebasien Konieczy and et el Muhammed Al-Muhammed.
GCSE Computing#BristolMet Session Objectives# 21 MUST describe methods of validating data as it is input. SHOULD explain the use of key fields to connect.
1 Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – EER Model –21th June.
8 June Single table database in normal form Fields and records Normal form 1.Header in the first line 2.Same content for every field 3.Each record.
Fall 2009ACS-3913 R McFadyen1 Persistent Objects Persistent objects are objects that continue to exist after the application program terminates Persistence.
Translating from ER to Relationship Schema Adapted from Juliana Freire.
January Ron McFadyen1 Use Cases in the UML Functionality under consideration is represented by use cases (named ellipses) enclosed in a box.
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
LIS 557 Database Design and Management William Voon Michael Cole Spring '04.
Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Physical Database Monitoring and Tuning the Operational System.
March Ron McFadyen1 Using Rational Rose to create a database.
Mar 20, R McFadyen1 Persistent Objects Persistent objects are objects that continue to exist after the application program terminates Persistence.
March 31, R McFadyen1 Persistent Objects Persistent objects are objects that continue to exist after the application program terminates Persistence.
Assignment 4 Answers April 5, Cyclomatic complexity Either of these two representations is correct (simple sequences can be collapsed to.
Chapter 17 Methodology – Physical Database Design for Relational Databases Transparencies © Pearson Education Limited 1995, 2005.
© Pearson Education Limited, Chapter 12 Physical Database Design – Step 3 (Translate Logical Design) Transparencies.
Team Dosen UMN Physical DB Design Connolly Book Chapter 18.
Mapping ERM to relational database
CANKAYA UNIVERSITY FOREIGN LANGUAGES UNIT
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA.
DATA MODELING AND DATABASE DESIGN
Lecture 9 Methodology – Physical Database Design for Relational Databases.
Chapter 21 B Mapping to ODL Copyright © 2004 Pearson Education, Inc.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Chapter 16 Methodology – Physical Database Design for Relational Databases.
IDENTIFYING SUPPORTING DETAILS
Bottom Up Analysis Bottom-up Data Analysis An Example.
Chapter 2 Data.
Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence.
Question and Answer Samples and Techniques. Simplify the expression: (x 4 y -2 )(x -3 y 8 )
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
10/10/2012ISC239 Isabelle Bichindaritz1 Physical Database Design.
5. Database Design Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis Using Spreadsheets 1.
Methodology – Physical Database Design for Relational Databases.
Nov 20, R McFadyen1 Persistent Objects Key ideas/definitions UML representations Mapping patterns Transactional states Example Some commercial.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Scientific Method. Ask a question Ask a question.
INFO275 Database Management Term Project. Overview Your project will be to define, design and build a functioning database, to support an application.
CS263 Lecture 5: Logical Database Design Can express the structure of a relation by a Tuple, a shorthand notation Name of the relation is followed (in.
advanced data modeling
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
Modelling Methodologies Chapter 16, 17, 18. Modeling Methodologies2 Database Design Physical DB design Logical DB design Conceptual DB design Hardware.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” Used to capture and describe.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Overview/Review of DB Logical Design ER Model to Relational Model Mapping.
MANY-TO-MANY MAPPING. May 12, 2011  Implemented using a Set java collection  Mediator table is mandatory – Join table  Join table contains foreign.
1 Microsoft Access 2002 Tutorial 2 – Creating And Maintaining A Database.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Sept Ron McFadyen1 Include Relationship UC1:Process Sale … Main Success Scenario … 7. Customer pays and System handles payment. … Extensions.
Java Software Solutions
Entity-Relationship Model
Tutorial 3 – Querying a Database
What is a Database? A collection of data organized in a manner that allows access, retrieval, and use of that data.
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
CS 3630 Database Design and Implementation
Year 2 Autumn Term Week 13 Lesson 3
The Scientific Method.
The Scientific Method.
Retail Sales is used to illustrate a first dimensional model
CMPE/SE 131 Software Engineering March 9 Class Meeting
The Scientific Method.
Introduction Growth of Bacteria.
Year 2 Autumn Term Week 13 Lesson 3
Summary of Transformation Rules
Java Software Solutions
Presentation transcript:

March 27, R McFadyen1 OR Mapping - Example When we map this structure to a Relational Database, we are creating an object-to-relational mapping. We need to define the relational database schema and specify which class(es) map to which relation(s), and whether the associations are mapped to relations or to foreign keys. Suppose we have the following class model: Program name type description Course name credit description * * Offering slot room contains * offer In question 4 on assignment 4, you are asked to design an object to relational mapping. The answer must indicate the resulting the relational database and the mapping.

March 27, R McFadyen2 Example - recall patterns for O-R mappings O-R Mapping The Representing Objects as Tables pattern says that each class will be represented in the RDb by a separate table (relation). The Object Identifier pattern tells us that each table representing a class will have the OID as the PK. The Representing Object Associations as Tables pattern gives us several options: use an association table to represent the association (for 1-1 and 1-m) we can choose to use a Foreign Key for a 1-1 we can choose to merge the two classes into one table etc

March 27, R McFadyen3 Example - mapping ClassMaps to Relation Program Course AssociationMaps to Relation/FKey containsTable: Contains offerFK in Offering (refers to Course) Offering O-R Mapping, for the given class model we could decide: Course Program

March 27, R McFadyen4 Example - mapping Relational Schema Program Course Offering nametypedescription slotroom namecreditdescription Contains pOID oOID cOID pOID cOID Illustrates the structure of the relations PKs are underlined. FKs are indicated via dashed lines. cOID

March 27, R McFadyen5 Example - mapping Table structure with some sample records Program Course nametypedescription C Programming3This course introduces … pOID yearR123 4-yearR Java Programming Systems Analysis namecreditdescriptioncOID A 3-year programme of studies in Business Computing

March 27, R McFadyen6 Example - application models Note that these relational structures are very different from the class structures that application programs would use. For example, a course object will contain, within it, its offerings: public class Course { private Hashtable Offerings = new Hashtable(); … course_offering = new Offering (…) Offerings.put (…, course_offering); } Part of the complexity of a system that uses objects and tuples/rows in an RDb is the translation from/to the other. A collection of course offerings Adding a course offering to the collection