LearningPatterns: Your Global Source for Java Training, Mentoring, and Consulting
Home | About LearningPatterns | Our Services | Contact Us | Printer Friendly Link

Courseware for License:

Fast Track to Enterprise JavaBeans 3.0 (EJB3) and the Java Persistence API (JPA) on the JBoss® Application Server

Course ID: EJB3-JPA

All labs are done using the JBoss 4 or JBoss 5 Application Server as the server platform, and the lab instructions include detailed directions on using JBoss. Labs are done with the Eclipse IDE, and the lab instructions also include instructions for using Eclipse.

The Enterprise JavaBeans 3.0 specification is a deep overhaul of the EJB specification that is intended to improve the EJB architecture by reducing its complexity from the developer's point of view.  It leverages annotations (introduced in Java 5) and Object-Relational Mapping (ORM) technologies to eliminate the dependence on complex EJB APIs, allow POJO (Plain Old Java Object) based development, and provide an effective technology for creating distributed, transactional components, and for mapping relational data to an object schema.

This course provides thorough coverage of the EJB3 technology - presented in a clear and effective manner. It starts with the basic concepts and APIs of EJB and then continues on with complex topics such as message driven beans and transactions.  New concepts such as the use of annotations and the use of Dependency Injection to initialize references are covered in depth. The course also includes thorough coverage of managing persistence using the Java Persistence API (JPA).  This course provides additional coverage of JPA as compared to our Fast Track to EJB3 course.

The coures uses hands-on labs and a well-paced approach to make this complex technology understandable in an accelerated fashion.  You will come away with a comprehensive understanding of EJB and the important issues that need to be considered to use it in real world applications. This course can be customized to your requirements.

Course Information

Duration: 4 days

Hands-on: 50% hands-on, 50% lecture

Supported Platforms:

Skills Gained:

Course Details:

Session 1:  Introduction

  • Overview of EJB and Java Persistence API (JPA)
    • Goals of EJB, EJB in the Java EE architecture
  • EJB 3.0 Overview
    • Session Beans, Persistent Entities, Message Driven Beans
  • Lab: JBoss AS Server setup and introduction

Session 2:  Session Beans

  • Session Bean Overview
    • Services provided, Stateless and Stateful Beans
    • Defining a Session Bean - EJB 3 Annotations
    • The Bean Implementation, Remote and Local Business Interface
  • Packaging and Deployment
    • ejb-jar file, Deployment Descriptors in EJB 3
    • EAR file
    • The EJB Container
  • Lab: Creating a Stateless Session Bean
  • JNDI Overview
    • Distributed Naming and Lookup
    • Context and InitialContext
    • Using JNDI
  • Writing an EJB 3 Client
    • Client View of a Session Bean
    • PortableRemoteObject and Casting
    • Running the Client
  • Lab: Creating an EJB Client

Session 3:  Additional Capabilities

  • Resources and Dependency Injection
    • EJB referencing another EJB
    • Referencing Resources, Environment Entries
    • Connection Factories (DataSource and others)
  • Lab: Using Dependency Injection
  • Lab: Creating and Using Environment Entries
  • Session Bean Lifecycle and Interceptors
    • Stateless Session Bean Lifecycle
    • Business Method Interceptors,  InvocationContext, Lifecycle Callback Interceptors, Interceptor Classes
  • Lab: Working with Interceptors
  • Stateful Session Beans
    • Overview
    • Defining, Client Relationship
    • Lifecycle, Activation, Passivation
  • Lab: Stateful Session Beans
  • Timer Service
    • Overview and usage

Session 4:  Message-Driven Beans

  • Overview of Messaging Systems
    • Messaging, Loose Coupling
    • Pub/Sub, Point2Point
  • Overview of JMS API
    • Overview and Structure
    • ConnectionFactory and Destination
    • JMS Producer and Consumer Client example
    • JMS Messages
  • Message-Driven Beans (MDB)
    • Overview and Goals
    • @MessageDriven and MDB example
    • Configuring with activationConfig
    • State Diagram and Interceptors
  • Lab: Message Driven Beans

Session 5:  Transactions and Security

  • Overview of Transactions and Transactional Systems
    • ACID, Transaction Managers, Resource Managers
  • Transactions in EJB 3
    • Declarative Transaction Management
    • Transaction Attributes and Transactional Scope
    • Transaction Scenarios and Bean-Managed Tx
  • Lab: Working with Transactions
  • Security
    • Java EE Security Overview (Role-based)
    • @RolesAllowed, @PermitAll
    • Programmatic Security
  • Lab: Integrating EJB and Java EE Security

Session 6:  Exceptions

  • Exception Overview
    • Checked and Unchecked Exceptions
  • Exceptions in EJB 3
    • Application Exceptions, System Exceptions
  • EJB 3 Best Practices
    • When to Use, Coarse-Grained Business Interfaces, Session Façade, Transaction Guidelines, Clustering

Session 7:  Introduction to Java Persistence API (JPA)

  • Overview
    • Persistence Layers, Object-Relational Mapping (ORM), JDBC
    • JPA Overview
  • Mapping with JPA
    • Entities and @Entity, ids and @Id,
    • Generated Id Values
    • Basic Mapping Types
  • Lab: Mapping an Entity Class
  • EntityManager
    • Persisting to the DB, the EntityManager,
    • Persistence Units and Configuration
    • Injecting an EntityManager
    • Retrieving Persistent Entities
  • Lab: Using the EnityManager to persist and find an Entity

Session 8:  Updates and Queries

  • Inserting and Updating
    • Transient, Persistent, Detached, Removed
    • Persisting new Entities, Updating a Persistent Instance
  • Lab: Inserting and Updating an Entity
  • Querying and JPQL
    • Object Based Queries, Select statements, WHERE clause
    • Named Queries
  • Lab: Creating and Using JPQL Queries
  • Versioning and Optimistic Locking
    • Overview
    • Detached Entities
    • Creating Versioned Entities
  • Lab: Optimistic Locking

Session 9:  Entity Relationships

  • Relationships Overview
    • Object Relationships, Participants, Roles, Directionality, Cardinality
  • Relationship Mapping
    • Mapping Overview (1-1, 1-N, N-1, N-N)
    • Unidirectional and Bidirectional
    • Mapping One-One, One-Many
    • Join Columns
    • Relationship Inverses
  • Lab: Mapping Entity Relationships
    • Many-Many Relationships
    • Lazy and Eager Loading
    • Cascading
    • Queries Across Relationships (Inner Joins, Outer Joins, Fetch Joins)
  • Lab: Querying Across Relationships
  • Inheritance Mapping
    • Entity Inheritance
    • Single Table, Joined (Table per Subclass), Table per Concrete Class
    • Pros and Cons
  • Lab: Mapping Inheritance

Session 10:  Additional JPA Capabilities

  • Queries - Projection, Aggregate, Bulk Update/Delete
  • Embedded Objects
  • EJB 3 and Java SE
  • Best Practices
    • Primary Keys, Named Queries, Lazy/Eager Loading, Transactional Semantics, Encapsulation, Report Queries
   
Home | About LearningPatterns | Our Services | Legal | Contact Us       Copyright © LearningPatterns, Inc. All rights reserved.