Course Description
In this Hibernate online training course, JSP and servlet programmers will learn how to integrate their enterprise applications with the open-source Hibernate framework for persisting information to databases. You will also learn how the Hibernate architecture implements best practices in Web application Development for persisting information to databases.
In This Course You Will Learn:
- Install and configure the Hibernate product using XML.
- Explain how Hibernate maps a database table or entity to a Java object.
- Use Hibernate Query Language (HQL) to query and update database entities through Hibernate objects.
- Map uni-directional and bi-directional relationships in Hibernate.
- Implement inheritance in Hibernate mapping.
- Control transactions in Hibernate.
- Control caching and perform other advanced efficiency optimizations within Hibernate.
Prerequisites
You need to have experience with Java programming, servlets programming, JSP and JavaBeans and be familiar with Web page development (HTML and XML). If you do not have this experience, we recommend the following GogoTraining courses:
Outline
Module 00: Introduction to Hibernate Online Training - Course Introduction
Module 01: Introduction to Hibernate
• Issues with Persistence Layers and Object-Relational Mapping (ORM)
• Hibernate Architecture Overview
• Hibernate Benefits
• POJO (Plain Old Java Object) Based Mapping
Module 02: Getting Started with Hibernate Quickly
• Overview of the Hibernate Distribution
• Configuring Hibernate
• hibernate.cfg.xml File
• SessionFactory Configuration
• Connection Properties, Database Dialect
• Configuration Class, Session Interface
• Lab Exercise: Getting Started with Hibernate
• Lab Exercise: "Hello World" Program for Hibernate
Module 03: Getting Started with Hibernate Quickly Part 2
• Mapping a Class
• Persistent Entity Class, Hibernate Mapping File, Mapping the Entity Class
• Primary Keys: Id Property, Generated Id
• Hibernate Type System
• Working with Sessions and Persistent Objects
• Logging - log4j Overview and Configuration for Hibernate
Module 04: Querying in Hibernate
• Inserting and Updating Entities
• HQL - Hibernate Query Language Overview
• The Query Interface
• Creating and Working with Queries
• Named Queries, Projection Queries, Aggregate Queries
• Lab Exercise: Queries in Hibernate
Module 05: The Hibernate Persistence Lifecycle
• Transaction Overview and Transactions in Hibernate
• Hibernate Transaction API (in Managed and Non-Managed Environments)
• The Lifecycle of Managed Objects
• Persistent, Transient and Detached Objects
• The Persistence (Session) Context (Lifespan, Relation to Managed Objects, Propagation)
• Contextual Sessions
• Synchronization to the Database
• The Session as Cache
Module 06: Optimistic Locking and Versioning in Hibernate
• Detached Objects and Optimistic Locking
• Versioning Overview and Using Versioning
• Locking Objects
Module 07: Relationships in Hibernate
• Object Relationship Overview
• Mapping Collections of Value Objects
• Entity Relationships: 1-N, N-1, N-N, 1-1
• Mapping Entity Relationships
• Uni- and Bi-Directional Relationships
• The "Inverse" Relationship
• Cascading Over Relationships
• Queries Across Relationships (Lazy and Eager)
• Lab Exercise: Relationships in Hibernate
Module 08: Inheritance Mapping in Hibernate
• Entity Inheritance with Hibernate
• Table-per-Class Mapping
• Table-per-Subclass Mapping
• Table-per-Concrete Class Mapping
• Lab Exercise: Inheritance Mapping in Hibernate
Module 09: Additional Querying Capabilities of Hibernate
• Projection Queries, Aggregate Queries
• Bulk Updates and Deletes
• Native SQL Queries
• Query Filters
Module 10: The Hibernate Criteria API
• Overview of the Criteria API
• Working Querying with the Criteria API
• Query by Example
• Lab Exercise: Hibernate Criteria API
Module 11: Hibernate and Java Persistence/EJB 3
• Overview of Java Persistence/EJB 3
• Relationship between Java Persistence and Hibernate
• Overview of Annotations
• Mapping Entities with Hibernate Annotations
• The EntityManager, Persistence Context and Persistence Unit
Module 12: Hibernate and Transactions
• Working with Transactions - EntityTransaction, Managed and Unmanaged Environments
• Inserts and Updates
• JPQL - Java Persistence Query Language
• Versioning
• Relationships
Module 13: Advanced Hibernate Topics
• Components and Multi-Table Mapping
• Equals() and hashCode()
• Caching and Efficiency
• Design Considerations
Module 14: Course Summary