Java Persistence API (JPA) - A Brief Overview

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Java Persistence API (JPA) - A Brief Overview - Presentation Transcript

    1. Java Persistence API (JPA) A Brief Overview By Scott Rabon
    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
    12. Aspects: Simple Configuration • Java SE 5 Annotations • XML • Heavy use of defaults 11
    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
    14. Entities Not same as entity beans 13
    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
    22. The End 5 minutes of question time starts now!
    23. Questions 4 minutes left!
    24. Questions 3 minutes left!
    25. Questions 2 minutes left!
    26. Questions 1 minute left!
    27. Questions 30 seconds left!
    28. Questions TIME IS UP!

    + Craig DicksonCraig Dickson, 4 months ago

    custom

    546 views, 0 favs, 1 embeds more stats

    This is a lightning presentation given by Scott Rab more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 546
      • 536 on SlideShare
      • 10 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 20
    Most viewed embeds
    • 10 views on http://craigsdickson.me

    more

    All embeds
    • 10 views on http://craigsdickson.me

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories