Professional Documents
Culture Documents
Chap 14
Chap 14
Chap 14
OBJECTIVES
Define terms
Understand mismatch between object-oriented and
relational paradigms and the consequences of mismatch
Understand similarities and differences between
approaches used to address object-relational mismatch
Create mapping between OO structures and relational
structures using Hibernate
Identify primary contexts for the different approaches of
addressing the object-relational mismatch
Understand performance, concurrency, and security
effects of object-relational mapping
Use HQL to formulate queries
Chapter 14-Web
Chapter 14-Web
STORAGE IN OO SYSTEMS
Persistence
Serialization
Chapter 14-Web
OBJECT-RELATIONAL IMPEDANCE
MISMATCH
Chapter 14-Web
identity
Property
Accessor
method
Chapter 14-Web
(API)
SQL Mapping Frameworks
Object-Relational Mapping Frameworks
Proprietary Approaches
Chapter 14-Web
CALL-LEVEL APIS
Chapter 14-Web
10
Chapter 14-Web
Chapter 14-Web
11
PROPRIETARY FRAMEWORKS
Example:
Microsofts
(LINQ)
Goal:
very
Chapter 14-Web
12
Figure 14-3
Object-oriented
domain model
Chapter 14-Web
13
Chapter 14-Web
14
Chapter 14-Web
15
Chapter 14-Web
16
Chapter 14-Web
17
Another ORM
mapping
Chapter 14-Web
18
Another ORM
mapping
Chapter 14-Web
19
Chapter 14-Web
20
MAPPING OO STRUCTURES TO A
RELATIONAL DATABASE
Chapter 14-Web
21
Chapter 14-Web
22
MAPPING OO STRUCTURES TO A
RELATIONAL DATABASE
Chapter 14-Web
23
MAPPING OO STRUCTURES TO A
RELATIONAL DATABASE
Chapter 14-Web
24
MAPPING OO STRUCTURES TO A
RELATIONAL DATABASE
Chapter 14-Web
25
Chapter 14-Web
26
Chapter 14-Web
27
to SQL
Different approaches to handling joins
Implicit
association join
Ordinary join in FROM clause
Fetch join in FROM clause
Theta-style join in WHERE clause
From Bauer and King (2006, p645)
Chapter 14-Web
28
Implicit join
(simple many-to-one)
Equivalent
SQL query
Chapter 14-Web
29
Explicit join
(complex many-to-one)
Equivalent
SQL query
Chapter 14-Web
30
Chapter 14-Web
31
Chapter 14-Web
32