Free Sample
+ Collection

EJB 3 Developer Guide

Michael Sikora

Enterprise JavaBean 3 - a Practical Book and eBook Guide for developers and architects using the EJB Standard.
RRP $23.99
RRP $39.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781847195609
Paperback276 pages

About This Book

  • A rapid introduction to the features of EJB 3
  • EJB 3 features explored concisely with accompanying code examples
  • Easily enhance Java applications with new, improved Enterprise Java Beans


Who This Book Is For

This book is primarily aimed at professional developers who already have a working knowledge of Java. Enterprise architects and designers with a background in Java would also find this book of use. Previous experience of working with Java is essential and knowledge of relational databases is desirable.

As this book is an introduction to EJB 3, it is aimed at those who are new to EJB 3. As the new version of EJB is so radically different from the previous version (EJB 2.x), the book is suitable for and should be of interest to those who have had experience working with EJB 2.x. The text makes it clear where the differences between the versions of EJB lie, although they are not explored in detail.

Table of Contents

Chapter 1: Introduction to the EJB 3 Architecture
Introduction to the Java EE Architecture
The EJB 3 Architecture
Getting Started
Chapter 2: Session Beans
Stateless Session Beans
Stateful Session Beans
Local Interfaces
Chapter 3: Entities
EJB 3 Entities
Introducing the EntityManager
Packaging and Deploying Entities
Field-Based Annotations
Generating Primary Keys
Overriding Metadata Defaults
Chapter 4: Object/Relational Mapping
O/R Mapping Default Behavior
O/R Mapping Overriding Defaults
O/R Mapping Additional Annotations
O/R Inheritance Mapping
Chapter 5: The Java Persistence Query Language
Simple Queries
Conditional Expressions
Aggregate Functions
Queries with Relationships
Collection Comparison Expressions
Constructor Expressions
Queries with Parameters
Named Queries
Handling Date and Time
Bulk Update and Delete
Native SQL
Chapter 6: Entity Manager
Application-managed Entity Manager
Entity Manager Merge
Entity Manager Methods
Cascade Operations
Extended Persistence Context
Entity LifeCycle Callback Methods
Chapter 7: Transactions
Container-Managed Transaction Demarcation
Examples of Transaction Attributes
Controlling Container Managed Transactions
Concurrency and Database Locking
UserTransaction Interface
Chapter 8: Messaging
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
MDB LifeCycle
MDB Example Revisited
Sending Message Confirmation to a Client
MDBs and Transactions
Chapter 9: EJB Timer Service
Timer Service Examples
A Timer Interface Example
Timers and Transactions
Chapter 10: Interceptors
Interceptor Methods
Interceptor Classes
Default Interceptors
Interceptor Communication
Chapter 11: 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
Chapter 12: EJB 3 Security
Java EE Container Security
EJB Authorization
Java EE Web Container Security

What You Will Learn

This book will teach you the core elements of EJB 3 technology. You will:

  • Gain a rapid introduction to the EJB 3 essentials while learning about the underlying principles
  • Create Entities, Message-Driven Beans, Session Beans and their clients
  • Look at running an EJB client from an application client container
  • Learn how to package and deploy an EJB
  • Use JQPL (Java Persistence Query Language)
  • Explore the entity manager interface
  • Learn about object/relational mapping with EJB 3
  • Look at the Java Messaging API and message-driven beans
  • Look at transactions, interceptors, and EJB timer services
  • Understand how EJB 3 differs from the 2.x version
  • Implement EJB 3's security features

In Detail


Read More