CO-77746 Java EE 6: Develop Database Applications with JPA Summary Duration 4 Days Audience Database Developers, Java EE Developers Level Professional Technology Java EE 6 Delivery Method Instructor-led (Classroom) Training Credits Yes Introduction This four-day Java EE 6: Develop Database Applications with JPA NEW course explores using the Java Persistence API within the context of a web-based Java Enterprise Edition application, as well as within a stand-alone Java Standard Edition application. This includes using Java Persistence API with the Enterprise JavaBeans technology. Learn how to accelerate the development of applications that use relational databases by mapping tables and table relationships to Java objects using Java Persistence API. You will also see how JPA solves issues with traditional relational database applications, including SQL injection. Prerequisites Before attending this course, students must meet the following prerequisites: Oracle requires and recommends that delegates have attended the following course prior to attending this course. Required Course: D667238GC20 Java SE 7 Programming Required Course: D65269GC20 Developing Applications with the Java EE 6 Platform Target Audience Database Developers, Java EE Developers Course Content Lesson 1: Introduction to the Course This Lesson introduces the course goals and the learning environment.
The Java curriculum Course goals Course objectives Describe the role of the JPA in Java SE and Java EE applications Explain the basics of object-relational mapping Lesson 2: Introduction to the Java Persistence API This lesson describes the features of the Java Persistence API (JPA) and object-relational mapping (ORM). Describe the Java Persistence API (JPA) Define object-relational mapping (ORM) and describe how JPA provides a framework to support ORM Use JPA to create, read, update, and delete database entities Create typed queries in JPA Create the Employee Database and Select an ID Generation Strategy Create the Employee Entity from an Employee POJO Implement the JPA Methods to Create, Read, Update, Delete, and List Employee Entities Lesson 3: Working with JPA in a Java Enterprise Edition Environment This lesson describes how with resource-local transaction demarcation, JPA relies on the JDBC driver to manage transactions. In a container, transactions are managed through the Java Transaction API (JTA). Containers typically add a layer on top of JDBC to manage transaction context. Evaluate the role of the container with JPA Access JPA entities from a servlet Evaluate the application of JavaServer Faces (JSF) as a user interface framework Access JPA entities from Enterprise JavaBeans (EJB) Determine the impact of using stateless, stateful, and singleton session beans on entities Configure a persistence context in an EE context Configure NetBeans to Control WebLogic Server Create a Servlet/JPA Employee Management Application Create a JSF/JPA Employee Management Application Lesson 4: Introduction to the Auction Application Case Study This lesson introduces the auction application case study used throughout the course. Describe the Auction Application Define the domain objects of the Auction Application Describe the implementation model for the auction system Review the Current Functionality of the Auction Application Review the Auction Application Classes Lesson 5: Modelling Relational Databases with JPA Entities This lesson explains how to model relational databases with JPA. Examine association relationships in the data and object models Use relationship properties to define associations Implement one-to-one unidirectional associations Implement one-to-one bidirectional associations
Implement many-to-one/one-to-many bidirectional associations Implement many-to-many bidirectional associations Implement many-to-many unidirectional associations Build the Database Schema Make Entities of the POJOs in the Model Package and Add a Persistence Unit to the Project Model the Single-Valued Associations for the Auction Application Model the Collection-Valued Associations for the Auction Application Lesson 6: Working with the Entity Manager This lesson describes the use of the Entity Manager to perform operations on database entities. Describe the relationship between an entity and an entity manager, and between a persistence context and a persistence unit Differentiate between transaction-scoped and extended entity managers Describe the entity life cycle Use entity manager operations to perform CRUD operations: persist, find, merge, remove Examine the role of the entity manager with detached entities Define and use cascading operations Implement the EJB Classes AuctionFacade, AuctionUserFacade, ImageFacade, and ItemFacade Apply Cascade Attributes to the One-to-One Relationships Populate the Database with Initial Data and Test the Application Lesson 7: Persisting Enums and Collections This lesson explores the use of built-in enumerations and collections. Enums with @Enumerated Lists with @ElementCollection Maps Apply @Enumerated to Enum Types in Entities Creating a Collection Type Lesson 8: Creating Queries with the Java Persistence Query Language (JPQL) This lesson describes how to construct database queries through the use of Java Persistence Query Language (JPQL). Describe the Java Persistence Query Language (JPQL) Contrast JQPL with native queries Use conditionals to filter results Refine queries to return only needed data Perform joins between entities Aggregate queries Create dynamic queries with parameters Use named queries Perform bulk updates and deletes Creating Dynamic Queries with JPQL Creating NamedQueries Lesson 9: Using the Criteria API This lesson describes the Criteria API, which can be used as an alternative to JPQL.
Contrast the Criteria API with JPQL Use the Criteria API structure and core interfaces CriteriaQuery, SubQuery, AbstractQuery Create SELECT, FROM, and WHERE clauses Create paths and expressions Use ORDER BY, GROUP BY, and HAVING clauses Use the canonical metamodel Use the Criteria API to Build Queries with JPA Lesson 10: Implementing Bean Validation with JPA This lesson describes how to perform and implement bean validation through the JPA. Describe the JPA lifecycle phases where validation takes place Create an entity listener class Describe Bean Validation Utilize validation groups Use built-in validation constraint annotations provided by Bean Validation Create a custom Bean Validation constraint Apply Bean Validation to the AuctionUser Entity Using Built-In Validation Rules Create a Custom Constraint Rule for the ZIP Code Field Lesson 11: Applying Transactions and Locking This lesson describes the concepts of transactions and transaction locking mechanisms. Describe transaction semantics Compare programmatic and declarative transaction scoping Use JTA to scope transactions programmatically Implement a container-managed transaction policy Support optimistic locking with the versioning of entity components Support pessimistic locking by using EntityManager APIs Describe the effect of exceptions on transaction state Apply Optimistic Locking to the Auction Application Lesson 12: Advanced Modelling: Entity Inheritance Relationships This lesson describes advanced data modelling concepts. Describe entity inheritance Evaluate object-relational mapping strategies for entity inheritance Inherit by using a mapped superclass Inherit from a non-entity class Apply single-table-per-class, joined-subclass, and table-per-class inheritance mapping strategies Use embeddable classes Override mappings with the @AttributeOverride and @AssociationOverride annotations Specify composite primary keys Create an Embedded Entity
Use Entity Inheritance and a Joined Table Strategy to Create the AutoItem Entity Lesson 13: Optimizing JPA Performance This lesson describes the techniques used to optimise the performance of a JPA application. Use lazy fetching to prevent the loading of entities that are not being used Use pagination to control the amount data that is needed at any one time Modify queries to prevent the N + 1 problem Create read-only queries Describe performance issues associated with IDENTITY ID generation Create and use stored procedures with JPA and EclipseLink Use cache optimizations with JPA and EclipseLink Apply Performance Optimization Techniques to the Auction Application Associated Certifications & Exam This course prepares students to write Exam: 1Z0-898 Java EE 6 Java Persistence API Developer Exam Accredited to certification(s): Oracle Certified Expert Java EE 6 Java Persistence API Developer