Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object To Relation Mapping

Similar presentations


Presentation on theme: "Object To Relation Mapping"— Presentation transcript:

1 Object To Relation Mapping

2 Data Structure Owner String name; String taxId; Account[] accounts; Account – is abstract String id; double balance; InterestBearingAccount extends Account double rate; int termDays; CheckingAccount extends Account double checkFee

3 1:1 and 1:many Mappings in the Data Model
Owner – name : one to many Owner – taxId : one to one Owner – Account : one to many Account – id : one to one IntBearAcct – rate : ??? IntBearAcct – termDays: ??? intBearAcct – minBal : ??? CheckingAcct – checkFee: ???

4 Horizontal Partitioning
Each concrete class is mapped to a table Owner String name; String taxId; Account[] accounts; Account – is abstract String id; double balance; InterestBearingAccount extends Account double rate; int termDays; CheckingAccount extends Account double checkFee

5 Vertical Partitioning
Each class is mapped to a table Owner String name; String taxId; Account[] accounts; Account – is abstract String id; double balance; InterestBearingAccount extends Account double rate; int termDays; CheckingAccount extends Account double checkFee

6 Unification Each sub-class is mapped to the same table Owner
String name; String taxId; Account[] accounts; Account – is abstract String id; double balance; InterestBearingAccount extends Account double rate; int termDays; CheckingAccount extends Account double checkFee

7 Chalk Board Exercise Assume that not only can an Owner have many Accounts, but an Account can have many Owners How does this change the data model? How Does It change database design?


Download ppt "Object To Relation Mapping"

Similar presentations


Ads by Google