Skip Navigation Links

Course Length:
2 Days
Course Description:
This course introduces Hibernate, a popular open-source object/relational mapping (ORM) tool that helps Java developers store and access persistent objects. Topics covered include Hibernate configuration, the Hibernate mapping file, inheritance, collections, associations, and the Hibernate Query Language (HQL).
Who Should Attend:
This course is for Java developers creating or maintaining applications that use a relational database and Java SE or Java EE, Java developers and architects investigating ORM alternatives.
Benefits of Attendance:
Upon completion of this course, students will be able to:
  • Describe the purpose and benefits of an object/relational mapping tool
  • Configure database connection properties in the Hibernate configuration file
  • Use a Hibernate mapping file to map a Java class to a database table
  • Create, save, update, and delete entities
  • Distinguish between entity and value types
  • Configure primary key generators for persistent classes
  • Describe and use the Hibernate strategies for mapping inheritance hierarchies
  • Map collections and associations
  • Write queries using Hibernate Query Language (HQL)
Prerequisites:
Students should have Java programming experience and knowledge of Structured Query Language (SQL).
Course Outline:
  • Chapter 1: Getting Started with Hibernate
    1. What is Hibernate?
    2. Using Hibernate
    3. Configuring Hibernate
    4. Hibernate Sessions
    5. Writing Classes for Hibernate Applications
    6. Sample Class and Mapping File
    7. Creating and Saving a New Entity
    8. Locating an Existing Entity
    9. Updating an Existing Entity
    10. Deleting an Entity
    11. Executing an SQL Query
    12. Programmatic Configuration
  • Chapter 2: Mapping Persistent Classes
    1. The Hibernate Mapping File
    2. Entities and Values
    3. Class Mappings
    4. Properties
    5. Derived and Generated Properties
    6. Mapping Value Types
    7. Key Generators
    8. Compound Keys
    9. Hibernate Types
  • Chapter 3: Inheritance
    1. Mapping Class Inheritance
    2. Table Per Class Hierarchy
    3. Table Per Subclass
    4. Table Per Concrete Class
    5. Using Implicit Polymorphism
  • Chapter 4: Collections and Associations
    1. Mapping Collections
    2. Collections of Components
    3. Sample Application - UML Diagram
    4. Sample Application - Database Schema
    5. Implementing Associations
    6. Mapping Associations
    7. The inverse Attribute
  • Chapter 5: Hibernate Query Language
    1. HQL Basics
    2. HQL Expressions
    3. HQL Functions
    4. Polymorphic Queries
    5. Executing Queries
    6. Scrollable Results
    7. Named Queries
    8. Associations and Joins
    9. Inner Joins
    10. Outer Joins
    11. Sample Queries
  • Appendix A: XDoclet and Java Annotations
    1. Using XDoclet Markup
    2. Using Annotations