Mastering Hibernate 4.x | Applying Hibernate to Persistence in Java

Course Details
Code: TT3200
Tuition (USD): $2,395.00 • Classroom (4 days)

Hibernate is a powerful enabler that addresses object/relational persistence in the Java world. Hibernate offers all the advantages of developing in Java plus a comprehensive suite of capabilities for mapping object-oriented features to the relational model. This course tells you what you need to know to design and build your own Hibernate-enabled applications. You'll learn the details of the key Hibernate capabilities and how to leverage their strengths, with a special focus on using Hibernate with other technologies and frameworks. At the same time, you'll be learning about the big picture of Hibernate and how to design applications to use Hibernate in a robust, efficient, secure, and maintainable fashion. If you want to deliver an application using Hibernate, you'll find this course essential.

Skills Gained

  • Explain how the issues associated with object persistence in a relational model are addressed by Hibernate
  • Understand the relationships between SQL, Java, JDBC, Spring, Java Persistence API, EJB 3.0, and Hibernate
  • Discuss the challenges to adopting Hibernate in the enterprise
  • Write applications that take advantage of the Hibernate Persistence Manager.
  • Map Java classes to relational tables.
  • Capture both relational and inheritance associations in metadata using either XML or the Java Annotations mechanism.
  • Create and use mappings between Java classes and relational databases.
  • Understand how identity and keys are handled in Hibernate.
  • Understand the persistent object lifecycle and how that relates to transactions and concurrency.
  • Take advantage of Hibernate's data filtering and interception.

Who Can Benefit

Experienced Java developers.

Prerequisites

This an intermediate level and beyond Java / Hibernate training course, designed for developers who need to understand how and when to use Hibernate in Java or JavaEE /JEE applications. Attendees should have practical basic Java development experience equivalent to our TT2100 Core Java Fundamentals course.

Course Details

Session: Introduction to Hibernate

Lesson: Introduction to Hibernate

  • Hibernate ORM
  • Lazy Loading
  • Hibernate Supports Caching

Lesson: Getting Started with Hibernate

  • Hibernate Classes
  • Hibernate Configuration
  • Mapping a Class to a Table
  • The Session
  • Attached and Detached
  • Methods to Control Object Life-Cycle

Lesson: Hibernate Annotations

  • Annotations Overview
  • Hibernate Annotations Overview
  • Annotations: Drawbacks and Benefits
  • Getting to Hibernate Annotations

Session: ORM with Hibernate

Lesson: Basic ORM

  • Hibernate Types
  • Identifier Column
  • Built-in Generator Types in Hibernate
  • Mapping Information
  • Joins

Lesson: Value-Type Collections and Components

  • Mapping Aggregates (One-to-One)
  • Collection Mapping
  • Hibernate Bags
  • Hibernate Lists
  • Hibernate Sets
  • Hibernate Maps

Lesson: Entity Associations (Relations)

  • Entity Associations
  • Mapping Associations
  • Fetching Strategies

Lesson: Mapping Inheritance

  • Strategies for Mapping Inheritance
  • Inheritance and Proxy Caveats

Session: Using Persistent Objects

Lesson: Reading, Updating and Deleting Objects

  • Session Scope
  • States
  • Transition: Transient to Persistent
  • Transition: "Hibernated" to Persistent
  • Transition: Detached to Persistent

Lesson: Transactions

  • Framework-Managed Transactions
  • Demarcating Transactions
  • Concurrency

Session: Querying in Hibernate

Lesson: Querying for Objects

  • Hibernate Type Implementations
  • The Hibernate Query Language
  • Pagination
  • The Criteria API
  • Detached Queries

Session: JPA and Hibernate (Optional)

Lesson: Java Persistence API (JPA) and Hibernate

  • Java Persistence API (JPA) Overview
  • JPA 2.0 Features
  • Hibernate and JPA
  • The JPA Package
  • Hibernate and JPA 2.0 Compliance

Lesson: Entities and Persistence

  • JPA Configuration Files
  • Mapping Objects to the Database
  • Annotated Mapping
  • EntityManager Works with Entities