Course duration: 2 Days
Overview
This course develops skills in using the Object/Relational Mapping tool Hibernate. The course uses the latest release version of Hibernate, 3.2, which is directly related to the new EJB 3.0 version defined in Java EE 5.0. By the end of the course, students will be prepared to set-up and use Hibernate as the persistence mechanism in Java applications.
Layout
The training course combines lectures with practical exercises that help the delegates to put what they have learned on the training course into practice. The exercises specifically build on what has been recently taught and are built up as the training course progresses.
Who it is for
Java Programmers
Training Course Prerequisites
Intermediate knowledge of Java programming and JDBC
Experience with SQL and relational databases
Training Course Objectives
At the end of this training course, students should be able to:
Introduction to Hibernate
Configuring Hibernate
Hibernate Persistence
Object/Relational Mapping
The Criteria Query API
The Hibernate Query Language
Training Course Contents
1. Introduction to Hibernate
Introducing Hibernate
The Object/Relational Mapping Problem
The Impedance Mismatch
JDBC
The Users-Roles Schema
Tools and Environment Setup
Creating the Database
The Role Class
The Hibernate Alternative
XML Tools
2. Configuring Hibernate
Hibernate Distributions
Required Libraries
Configuration Files
hibernate.properties
hibernate.cfg.xml
XML Configuration Model
Programmatic Configuration
3. Hibernate Persistence
The Hibernate Architecture
Interface Model
SessionFactory Methods
Hibernate Sessions
Object States
State Transitions
Session Methods
Transactions
Session-Per-Operation
Session-Per-Request
The Data Access Object Pattern
4. Object/Relational Mapping
Object-Oriented Design
Relational Mapping
Bidirectional Association
O/R Mapping Techniques
The Mapping Document
The Mapping XML Model
Primary Keys and Identity
Generating Identifiers
Other Mapping Elements
Earthlings Schema
Earthlings Relationships
Earthlings UML
Components
Mapping Associations
The Mapping XML Model for Associations
Unidirectional Many-to-One
Eager Fetching
Bidirectional One-To-Many
Bidirectional One-To-One
Mapping Inheritance
Inheritance and Databases
Single-Table Inheritance
Mapping Single-Table Inheritance
Table-Per-Subclass
Table-Per-Subclass Mapping
Table-Per-Concrete-Class
5. The Criteria Query API
Criteria Queries
The Criteria Interface
The Criteria API
The Restriction Class Utility
Other Restrictions
Windowing Results
Sorting Query Results
Projections and Aggregates
The Projections Class Utility
The ProjectionList Class
Query By Example
6. The Hibernate Query Language
The Hibernate Query Language
Fundamentals
HQL Queries
Polymorphism
Named Parameters
Entity Parameters
Joining on Associations
Aggregate Methods
Updates and Deletes
Named Queries
Using Native SQL