PacktLib: EJB 3 Developer Guide

EJB 3 Developer Guide

Credits

About the Author

About the Reviewers

Preface

Introduction to the EJB 3 Architecture

Introduction to the Java EE Architecture

The EJB 3 Architecture

Getting Started

Summary

Session Beans

Introduction

Stateless Session Beans

Stateful Session Beans

Local Interfaces

Summary

Entities

Introduction

EJB 3 Entities

Introducing the EntityManager

Packaging and Deploying Entities

Field-Based Annotations

Generating Primary Keys

Overriding Metadata Defaults

Summary

Object/Relational Mapping

O/R Mapping Default Behavior

O/R Mapping Overriding Defaults

O/R Mapping Additional Annotations

O/R Inheritance Mapping

Summary

The Java Persistence Query Language

Introduction

Simple Queries

Projection

Conditional Expressions

Aggregate Functions

Queries with Relationships

Joins

Collection Comparison Expressions

Constructor Expressions

SubQueries

Functions

Queries with Parameters

Named Queries

Handling Date and Time

Bulk Update and Delete

Native SQL

Summary

Entity Manager

Application-managed Entity Manager

Entity Manager Merge

Entity Manager Methods

Cascade Operations

Extended Persistence Context

Entity LifeCycle Callback Methods

Summary

Transactions

Introduction

Container-Managed Transaction Demarcation

Examples of Transaction Attributes

Controlling Container Managed Transactions

Concurrency and Database Locking

UserTransaction Interface

Summary

Messaging

Introduction

Java Message Service (JMS) API

Queue Producer and Consumer Examples

Topic Producer and Consumer Examples

Motivation for Message-Driven Beans

A Simple Message-Driven Bean Example

MDB Activation Configuration Properties

MessageDrivenContext

MDB LifeCycle

MDB Example Revisited

Sending Message Confirmation to a Client

MDBs and Transactions

Summary

EJB Timer Service

Introduction

Timer Service Examples

A Timer Interface Example

Timers and Transactions

Summary

Interceptors

Interceptor Methods

Interceptor Classes

Default Interceptors

Interceptor Communication

Summary

Implementing EJB 3 Web Services

Overview of Web Service Concepts

Creating a Java Application Web Service

Overriding JAX-WS Annotation Defaults

Deploying an EJB Session Bean as a Web Service

Summary

EJB 3 Security

Java EE Container Security

Authentication

EJB Authorization

Java EE Web Container Security

Summary

Annotations and Their Corresponding Packages