Problem: How persist objects to a database? (Relational Database (Convert…
Problem: How persist objects to a database?
Simply use scalar values other than objects
Convert objects to a group of scalar values
Pros: reduce the amount of code that needs to be written
Cons: High level of abstraction obscuring what is actually happening in the implementation code.
Java Persistence API(JPA)
for accessing, persisting, and managing data between Java objects / classes and a relational database
Impact: Considered the standard industry approach for Object to Relational Mapping (ORM) in Industry.
Object-relational impedance mismatch
Granularity 2. Inheritance 3. Identity 4. Associations 5. Data navigation (
Typically XML or JSON
Main Category of
Data Access Object(
An object that provides an abstract interface to some type of database or other persistence mechanism. This isolation supports the
Single responsibility principle
Changing business logic can rely on the same DAO interface, while changes to persistence logic do not affect DAO clients as long as the interface remains correctly implemented