This is a lightning presentation given by Scott Rabon, a member of my development team. He presents a high level overview of the JPA based on his first exposure to it.
2. We have come a long way
⢠Java
application
persistence
history
â JDBC
â EJB Entity
Beans
1
3. Industry answered the call
⢠Proprietary
persistence products
were introduced
â JBoss Hibernate
â Oracle Top Link
2
4. Why Another Standard
⢠Standard goes
deeper than a product
⢠Can be implemented
by different vendors
⢠Developers code to
interface, not
implementation
3
5. A Standard Is Born
JSR 220 â EJB 3.0
Specification
Java Persistence
API part of EJB 3.0
Specification
4
6. JPA Fun Facts
⢠JSR 220 formed May
2003
⢠Released May 2006
⢠Expert group
consisted of industry
ORM developers
5
7. JPA â Designed for Ease of Use
⢠Main goal of design
team
⢠Elegant, powerful and
flexible
⢠Easy to learn
6
8. Aspects: POJO Persistence
⢠Objects are POJOâs
⢠Mapping is metadata
driven
⢠External XML or
annotation based
7
9. Aspects: Non Intrusiveness
⢠API does not intrude
on objects
⢠API exists as a
separate layer from
persistent objects
⢠Objects are
âunawareâ of the API
8
10. Aspects: Object Queries
⢠Query across entities
and relationships
⢠Expressed in Java
Persistence Query
Language (JPQL)
⢠Uses a schema
abstraction
9
11. Aspects: Mobile Entities
⢠Detachment Model
⢠Move entities
between JVMâs
⢠Can change state
anywhere along the
way
⢠Reattach upon return
10
13. Aspects: Integration and Testability
⢠Challenge: Testing on
an app server
⢠API works outside
application server
â Two tier apps
â Unit tests and
automated testing
frameworks
12
15. Entity Characteristics -
Persistability
⢠Entities must be persistable
⢠State can be represented in
a data store
⢠Entities can be manipulated
without having persistent
repercussions â app must
use API
14
16. Entity Characteristics - Identity
⢠Key that uniquely
identifies an instance
⢠Persistent identity
⢠Equivalent to primary
key
15
17. Entity Characteristics -
Transactionality
⢠Adds, updates and
deletes normally
occur in a transaction
⢠Changes succeed or
fail atomically
⢠In memory entities
16
18. Entity Characteristics - Granularity
⢠Not primitives,
wrappers, built-in
objects
⢠Are business domain
objects that mean
something
⢠Should be fairly
lightweight objects
17
19. Entity Manager
⢠Interface encapsulating
most persistence
functionality
⢠Set of managed
instances is named
persistence context
18
20. Queries
⢠Use JPQL syntax
⢠Can be defined
statically (named) or
dynamically
⢠Dynamic queries
supply query criteria
19
21. JPAâs future - Independence
⢠Break free from the
EJB specification
⢠Will get itâs own JSR
for future evolution
20