Duration: 4 days
This course offers a comprehensive and detail-oriented treatment of the Java Persistence API (JPA) for developers interested in implementing persistence tiers for enterprise applications. We cover JPA basics including simple object/relational concepts and annotations, persistence contexts and entity managers, and configuration via persistence.xml. We get a good grounding in the Java Persistence Query Language (JPQL), working with a JPQL console. The course then moves into advanced mapping techniques, the Criteria API, lifecycle hooks, validation, locking, and caching. Students will complete the course with a firm understanding of JPA architecture and plenty of hands-on experience.
• Understand the value of object/relational mapping and JPA's role as a standard for ORM implementations.
• Develop JPA entities using JPA annotations to align the Java classes, properties, and types to relational tables, columns, and types.
• Create entity managers and instantiate persistence contexts to perform create/retrieve/update/delete (CRUD) operations.
• Implement entity relationships of all cardinalities, including unidirectional and bidirectional relationships.
• Map composite primary keys, inheritance relationships, eager/lazy fetching, and cascading operations.
• Use JPQL to write object-oriented queries, and process query results.
• Use the Criteria API to define queries programmatically, and take advantage of type safety using the Metamodel API.
• Build reusable façades that encapsulate simpler and more complex persistence operations.
• Implement persistence lifecycle event handlers.
• Define JSR-303 validation constraints on JPA entities and see them enforced by the JPA provider.
• Manage concurrent opertaions via optimistic or pessimistic locking strategies.
• Understand the actions of the local and shared entity caches, and use them appropriately while avoiding over-caching pitfalls.
Method of Delivery
• Onsite/Live class instructions or Online web conference
• Open discussion
• Case studies