By Shantanu Narang CS 157b. Relational Model  Object Model Object Oriented Databases(OOD) Object Query Language(OQL) OOD pros and cons.

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Chapter 10: Designing Databases
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
SQL*PLUS, PLSQL and SQLLDR Ali Obaidi. SQL Advantages High level – Builds on relational algebra and calculus – Powerful operations – Enables automatic.
Review Indra Budi Fakultas Ilmu Komputer UI 2 Database Introduction Database vs File Processing Main purpose of database Database Actors.
Review for Final Test Indra Budi
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
Data Management Design
Database Systems More SQL Database Design -- More SQL1.
CSC 2720 Building Web Applications Database and SQL.
Session-01. Hibernate Framework ? Why we use Hibernate ?
Security and Integrity
Introduction to JPA Java Persistence API Introduction to JPA.
Object and object-relational databases 1. Object databases vs. Object-relational databases Object databases Stores complex objects – Data + functions.
By: Blake Peters.  OODB- Object Oriented Database  An OODB is a database management system in which information is represented in the form of objects.
Data Access Patterns Some of the problems with data access from OO programs: 1.Data source and OO program use different data modelling concepts 2.Decoupling.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
Introduction to Accounting Information Systems
Introduction to SQL Steve Perry
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
Component 4/Unit 6f Topic VI: Create simple querying statements for the database The SELECT statement Clauses Functions Joins Subqueries Data manipulation.
12-CRS-0106 REVISED 8 FEB 2013 CSG2H3 Object Oriented Programming.
SQL Server 7.0 Maintaining Referential Integrity.
Association of Computing Activities Computer Science and Engineering Indian Institute of Technology Kanpur.
Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence.
DATABASE TRANSACTION. Transaction It is a logical unit of work that must succeed or fail in its entirety. A transaction is an atomic operation which may.
“INTRODUCTION TO DATABASE AND SQL”. Outlines 2  Introduction To Database  Database Concepts  Database Properties  What is Database Management System.
Chapter 12: Designing Databases
Nitin Singh/AAO RTI ALLAHABAD 1 SQL Nitin Singh/AAO RTI ALLAHABAD 2 OBJECTIVES §What is SQL? §Types of SQL commands and their function §Query §Index.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 14 Using Relational Databases to Provide Object Persistence (Overview) Modern Database.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 18 Object- Oriented Database Processing.
OR Mapping Object relational mapping (ORM, O/RM, and O/R mapping)
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Oct * Brad Tutterow. VS 2008.NET 3.5LINQ Entity Framework  The ADO.NET Entity Framework is part of Microsoft’s next generation of.NET technologies.
Creating and Maintaining Geographic Databases. Outline Definitions Characteristics of DBMS Types of database Relational model SQL Spatial databases.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
SQL LANGUAGE and Relational Data Model TUTORIAL Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
Structured Query Language Introduction. Basic Select SELECT lname, fname, phone FROM employees; Employees Table LNAMEFNAMEPHONE JonesMark SmithSara
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
Introduction to Functions – Single Row Functions.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
9-1 © Prentice Hall, 2007 Topic 9: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 6 This material was developed by Oregon Health & Science.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
Chapter 3: Relational Databases
Program with PL/SQL Lesson 3. Interacting with the Oracle Server.
SQL Introduction to database and SQL. Chapter 1: Databases and Database Users 6 Introduction to Databases Databases touch all aspects of our lives. Examples:
11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
ORM Basics Repository Pattern, Models, Entity Manager Ivan Yonkov Technical Trainer Software University
CS 440 Database Management Systems Stored procedures & OR mapping 1.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
SQL Basics Review Reviewing what we’ve learned so far…….
Introduction to Entity framework
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
CIS 207 The Relational Database Model
Lecture 2 The Relational Model
SQL 101.
Structured Types (9-12-2) Structured types allow composite attributes of E-R diagrams to be represented directly. Unnamed row types can also be used in.
Contents Preface I Introduction Lesson Objectives I-2
Chapter 8 Advanced SQL.
Presentation transcript:

By Shantanu Narang CS 157b

Relational Model  Object Model Object Oriented Databases(OOD) Object Query Language(OQL) OOD pros and cons

Relation databaseJava Representation RelationClass TupleObject Composite Attributestruct Multi Valued AttributesCollection Objects Foreign KeyReference to an Objects

Relation databaseJava Representation One to OneStore worksAt = new Store(“BB”, UC); One to manyEmployee.worksOn = new Set (); Many to ManyAlmost all ORMs do not support many to many relationship. So most people have to hack there way around it. OR An easier way is to represent an the M-t-M as an entity class in the ERD. Preserve Referential Integrity(Important to update relationships)

// To make an employee a manager of a store /* store is the store that the employee will manage whether transaction was completed. */ protected boolean createManagerRelationsShip(Store store) { if(store.getManager() != null) return false; this.worksAt = store;// if different this.setManagerOf(store); store.setManager(this); return true; }

Single InheritanceClass Employee extends Person Multiple InheritanceNot allowed in java!! You have to create class variables, and manipulate them.(p. 442) Or Let interfaces simulate classes

Three ways to do it: 1.Write to file(text files, serialization in java) Impossible to load desired objects only. 2.Relational DBs. 3.Object DBs

The traditional Relational DBMS stores data in tables, rows, and columns Objects have several complex structures that cannot be represented in tables, rows, or columns. These structures include executable statements (i.e., methods) and pointers

An object database is a collection of persistent objects that act like a database. Object-relational mapping (aka ORM, O/RM, and O/R mapping) is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This creates, in effect, a "virtual object database" which can be used from within the programming language. Ex. Hibernate, LINQ, nHibernate.

OO vs. RM DBs

Based on SQL for an easier transition for programmers. Not as explicit as SQL, does not have command equivalent to the SQL-update. Example: Select distinct e.ssn from Employees e where e.lastname = “Booyaa” It will return a set object.

Select PayStatement(emp.id, emp.hours * emp.hourlySalary) from Employees emp where emp.isTemp() == true; #returns a set of new Paystatements object for all tempEmps

Supports Unions Intersections Except For all Exists Count Sum Nested statements Min Max Group by …………

The End