Hibernate and the Java Persistence API

Overview

Course code:

JVN016

Duration:

4

Time Unit:

Day(s)

Overview:

This course offers a comprehensive and detail-oriented treatment of Hibernate® 4.0 and the Java Persistence API (JPA) 2.0 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) and take advantage of a prepared JPQL query console to explore the two schemas on which the course's case studies are based. The course then moves into advanced topics including JPA-2.0 mapping options, the Criteria API, lifecycle hooks, JSR-303 validation, locking, and caching. Students will complete the course with a firm understanding of JPA architecture and plenty of hands-on exercise in entity mapping, persistence operations, and JPQL.

Learning Objectives :

- 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 persistence operations.
- Carry out create/retrieve/update/delete (CRUD) operations on JPA entities using entity managers.
- Implement entity relationships of all cardinalities, including unidirectional and bidirectional relationships.
- Implement special ORM cases such as composite primary keys, inheritance relationships, 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.
- Make well-informed decisions about locking strategies, and understand the role of the JPA cache in enterprise applications.