Intro to Java Persistence API (JPA)
In addition to providing a simplified API, the new EJB3 specification (JSR-220) defines a standard ORM Java Persistence API (JPA) that is rapidly gaining in popularity. As you will see in this session, JPA bears a striking resemblance to popular ORM solutions like Hibernate and Toplink. In this session we will explore in detail the new Java Persistence API offered by JSR-220. We will start by discussing the overall design and architecture of the JPA and how the major components within JPA interact. We will then look at defining mapping objects (entities) and how to use the EntityManager to manage these entities. Through interactive coding examples we will investigate the pros and cons of detached entities and merging, how to map and use entity relationships (1-1, 1-N, N-1, and N-N), discuss Lazy Loading, and finally see how to use XML mappings rather than annotations. More advanced features of JPA will be covered in a separate session.
Agenda
- Introduction
- JPA Framework Overview
- Defining and Mapping Entity Objects
- Managing Entity Objects (EntityManager)
- Detached Entities and Merging
- Entity Relationships
- Lazy Loading
- Using XML Mappings
- Summary
About Mark Richards
Mark Richards is an experienced, hands-on software architect involved in the architecture, design, and implementation of microservices architectures, service-oriented architectures, and distributed systems. He has been in the software industry since 1983 and has significant experience and expertise in application, integration, and enterprise architecture. Mark is the founder of DeveloperToArchitect.com, a website devoted to helping developers in the journey to software architect. He is the author of numerous technical books and videos, including the recently published Fundamentals of Software Architecture, Microservices AntiPatterns and Pitfalls, Microservices vs. SOA, the Software Architecture Fundamentals video series, The Enterprise Messaging video series, Java Message Service, 2nd Edition, and contributing author to 97 Things Every Software Architect Should Know. Mark has a master’s degree in computer science and is a regular conference speaker at the No Fluff Just Stuff (NFJS) Symposium Series. He has spoken at hundreds of conferences and user groups around the world on a variety of enterprise-related technical topics.
More About Mark »