Hibernate Training

Duration:2 Days

Course Overview

Hibernate is a high-performance object/relational persistence and query service. In this class, experienced Java developers learn how to put the Hibernate engine to work within their applications.

Day 1

  • Introduction to Hibernate

o    Hibernae Technology Benefits

o    Hibernate Architecture Overview

o    Persistence lifecycle

o    Object identity

  • Getting started with Hibernate quickly

o    Mapping tables to beans

o    Mapping properties to columns

o    Lab 1: Setting up the user Object

  • Relationships and Mapping

o    Setting up all types of relationships

o    Setting up a one to many relationship

o    Understanding bidirectional relationships

o    Lab 2: Setting up one to many relationship (Group to User)

o    Creating a simple application user authentication

o    Setting up a many to many relationship

o    Understanding unidirectional relationships

o    Lab 3: Setting up many to many relationship (User has roles)

o    Setting up a one to one relationship

o    Lab 4: Setting up one to one relationship (User has ContactInfo)

o    Setting up an simple inheritance relationship

o    Lab 5: Setting up an inheritance relationship (Employee is a user)

  • Basic queries

o    Working with queries

o    Named queries

Lab 5: Using queries and named queries

  • Using Hibernate Transaction support

o    Local transactions, global transaction

o    Hibernate transaction API

o    Isolation levels

o    Lab 6: Using Hibernate Transaction API

o    Optimistic and Pessimistic locking (versioning)

o    Lab 7: Implementing optimistic locking with versioning

Day 2

  • More mapping concepts

o    Hibernate type system

o    Mapping collections of value types

o    Three ways to map inheritance

o    Lab 8: Reimplementing Roles as a typed collection (User has Roles)

o    Lab 9: Reimplementing Employee as a separate table (Employee is a User)

o    Working with compound keys

o    Lab 9: Working with compound keys

  • Advanced Queries

o    Working with the Query API

o    Working with Binding Parameters

o    Grouping

o    Subqueries

o    Optimizing queries

o    Native SQL query

o    Lab 10: Using advanced query support

o    Lab 11: Using native SQL query support

  • Using Hibernate and Spring

o    Spring Intro

o    How Spring simplifies Hibernate development

o    Using HibernateTemplate

o    Using Spring DAO support

o    Using Spring's transaction support (declarative transactions)

o    Lab 12: Using Spring DAOs

o    Lab 13: Using declarative transactions

  • Hibernate Caching

o    Caching overview

o    Hibernate Caching Architecture

o    Hibernate API to control cache

o    Working with EHCache

o    Lab 14: Using EHCache to enhance performance