| |
| |
| |
|
|
|
Hibernate - Developing Java Relational Persistence Applications
|
|
Duration:
Three days
|
|
|
This course is designed for experienced Java developers, architects, and
designers.
-
Developers
-
Designers
-
Architects
-
Consultants
| |
Audience should know Java and have a working knowledge of relational
database and SQL.
|
|
|
Description
|
Hibernate is an open source object/relational mapping framework for Java.
It is lightweight, yet powerful enough to relieve the developers from
most of the manual work otherwise needed in handling data persistence.
This course covers all aspects of using hibernate in developing Java
relational persistence applications, from configuration, defining
mappings, writing complex queries, handling concurrency, transactions, to employing best practices.
This class is very hands-on and is filled with real-life practical examples and exercises drawn from our vast consulting experience building large-scale enterprise-class applications. We pay special attention to strategies relating to creating efficient and high performance, yet flexible and maintainable Hibernate applications. Using the knowledge gained from this class and the lab source code, you will be able to hit the ground running when you get back to work the day after the class.
This class is authored and taught by experts who have been developing Hibernate applications and mentoring development teams in this technology for more than 10 years. We use the latest stable version of Hibernate in this class.
At least 60% of the time will be devoted to labs.
|
|
Objectives
|
Upon completion, students will be able to:
-
Understand the Hibernate framework architecture
-
Write Hibernate configuration file
-
Write Hibernate mapping files
-
Define persistence classes
-
Write queries with Hibernate Query Language (HQL)
-
Use Java annotations to describe hibernate O/R mapping, queries and other configuration data
-
Master the Object-Relational mapping strategies from Java to relational tables
-
Understand the issues with concurrency and transactions in Hibernate applications
-
Identify and remove performance bottlenecks to create highly efficient applications
-
Learn best practices in using Hibernate to build real world applications
|
|
Course Outline
|
Overview of Java Persistence
-
Overview of Object-Relational Mapping (ORM)
-
Java-based ORM Frameworks
-
Impedence mismatch and solutions
-
Overview of Hibernate architecture
-
Setting up and running your first Hibernate application
Configuring Hibernate
-
Hibernate configuration property file
-
Hibernate configuration XML file
-
Java annotations for describing Hibernate configuration data
-
Hibernate mapping files
-
Database dialects
-
Hibernate API
-
Obtaining a SessionFactory
-
User-provided JDBC connection
-
Using code generation tool
-
Using schema generation tool
-
Using mapping file generation tool
O/R Mapping
-
Mapping strategies
-
Overview of the mapping file
-
Class to Table mapping
-
Mapping properties to columns
-
The id element and primary key
-
Identifier (primary key) generation methods
-
Composite primary keys
-
Hibernate data types
-
Custom value types
-
Mapping for collections and associations
-
Mapping for rich associations
-
Component mapping
-
Inheritance mapping
Manipulating and Querying Persistent Objects
-
Persistent classes (Entities)
-
Life cycle of an entity
-
Transient and Peristent states
-
Loading an object
-
Automatic checking for dirty state
-
Detached objects
-
Merging objects
-
Find methods
-
The Query interface
-
Performing CRUD operations
-
Criteria Queries
-
Using native SQL query
-
Using lifecycle and interceptor callbacks
-
Transactions and concurrency
Components
-
The domain model
-
Entities and values
-
Components
Associations
-
One-to-One
-
One-to-Many
-
Many-to-One
-
Many-to-Many
-
Uni-directional vs. Bi-directional
-
Using lists, maps, bags and arrays for collection-valued associations
| |
The Hibernate Query Language (HQL)
-
The select clause
-
The from clause
-
The where clause
-
Expressions
-
Aggregate functions
-
Sorting, grouping, etc.
-
Subqueries
-
Object fetching options
-
Named queries
-
Native SQL
Criteria
-
Restrictions
-
Query by Example (QBE)
-
Scrolling and pagination
-
Query hints
Inheritance
-
Strategies for modeling inheritance in the persistence layer
-
Table per concrete class
-
Table per (closed) class hierarchy
-
Table per sub-class
-
Polymorphism
-
Design and performance considerations in choosing the right inheritance strategy
Advanced Persistence
-
Lazy loading for performance
-
Cascaded operations
-
Proxy objects
Transactions
-
The Java Transaction API (JTA)
-
Configuring Hibernate transactions
-
Hibernate Transaction API
-
Concurrency
-
Transaction isolation levels
-
Optimistic and pessimistic locking
-
Versioning
Performance and Best Practices
-
Collections and performance
-
Cache
-
Hibernate Cache Architecture
-
Cache concurrency
-
Caching levels and regions
-
Eviction
-
The N+1 select problem (and how to avoid it)
-
Batch fetching
-
Sub-select fetching
-
Miscellenous tips and tricks
|
|
|
|