Course outline for Hibernate

Pre-requisites for learning Hibernate

Participants are expected to have good knowledge of Java and should be comfortable with relational database concepts

Lab Setup

Eclipse Oxygen Java/JEE Edition with JDK 8

Duration

3-4 days

Training Mode

Online training for Hibernate

We provide:

  • Instructor led live training
  • Self-paced learning with access to expert coaches
  • 24x7 access to cloud labs with end to end working examples

All jnaapti sessions are 100% hands-on. All our instructors are engineers by heart. Activities are derived from real-life problems faced by our expert faculty. Self-paced hands-on sessions are delivered via Virtual Coach.

Classroom training for Hibernate

Classroom sessions are conducted in client locations in:

  • Bengaluru
  • Chennai
  • Hyderabad
  • Mumbai
  • Delhi/Gurgaon/NCR

Note: Classroom training is for corporate clients only

Detailed Course Outline for Hibernate

Understanding Relational Database Design

  • Understanding ER design and Object Modeling
  • Comparing relational database design to Object Modeling
  • Types of relationships
  • Database storage structures
  • Need for indexes to increase efficiency
  • Object Relational Mapping
  • Impedance mismatch in OR Mapping
  • Expectations from an ORM framework

Hibernate Architecture

  • SessionFactory
  • Session
  • Transaction
  • Persistent Objects
  • Transient Objects
  • JDBC/JNDI/JTA

Getting started with Hibernate

  • Obtaining Hibernate
  • Using Hibernate via Maven
  • Hibernate - Hello World

Persistent Classes

  • A simple POJO example
  • Implementing inheritance
  • Implementing equals() and hashCode()
  • Dynamic models

Basic O/R Mapping

  • Mapping declaration
  • Hibernate types
  • Mapping a class more than once
  • SQL quoted identifiers

Types

  • Value Types
  • Entity Types
  • Custom Types

Collection Mapping

  • Persistent Collections
  • How to map collections
  • Sorted Collections
  • Bidirectional associations

Association Mappings

  • Handling Unidirectional and Bidirectional associations
  • Handling one-to-one, many-to-one, one-to-many and many-to-many relationships
  • Association using Join Tables and without Join Tables

Inheritance Mapping

  • Inheritance Mapping Strategies
    • Table per class hierarchy
    • Table per subclass
    • Table per concrete class
  • Limitations

HQL

  • Creating a query
  • Paging results
  • Parameter binding
  • Using positional parameters
  • Executing a query
  • Using database cursors

Working with Objects

  • Hibernate object states
  • Making objects persistent
  • Loading an object
  • Querying
  • Modifying persistent objects
  • Modifying detached objects
  • Automatic state detection
  • Deleting persistent objects
  • Replicating object between two different datastores
  • Flushing the Session
  • Transitive persistence
  • Using metadata

HQL and JPQL

  • Select queries
  • Polymorphic Queries
  • Comparison Expressions
  • Projection
  • Joins
  • Reporting Queries

Criteria Queries

  • Basic criteria queries
  • Narrowing the result set
  • Ordering the results
  • Projections
  • Joins
  • When to use Criteria vs HQL

Native SQL

  • Using SQLQuery
  • Named SQL Queries
  • Custom SQL for create, update and delete
  • Custom SQL for loading

Improving Performance

  • Fetching strategies
  • Second level cache
  • Query Cache
  • Understanding collection performance