section_text

DT offers a core set of courses aimed at covering the Application Lifecycle, from requirements gathering, analysis and design to development, testing, process and project management.

section_grafx
  

Hibernate and Spring


Course Overview
This in-depth, Advanced workshop using Hibernate and Spring will present developers with best practices for software development, as well as tips and techniques for working with the tools and technologies within their specific environment.

The comprehensive Hibernate part provides complete coverage of the world of Hibernate. With a strong hands-on character and many (many!) ready to use demos, this course makes you competent to start correctly using Hibernate the minute you leave the class room.

What will I learn?
This is an intermediate level Java programming course, designed for developers who wish understand Hibernate and Spring.

The student should be an experienced J2EE / Java programmer, with practical development experience using Servlets/JSPs


Course Style
This course is hands-on with practical exercises throughout. We provide you with individual PC’s so that you are able to work alone. Class sizes are kept small so that you will receive personal attention. You will take away extensive printed course material, which will be of on going use to you in your work

Course Contents
Session: Introduction to Hibernate

* Lesson: Introduction to Hibernate
* Lesson: Getting started with Hibernate

Session: ORM with Hibernate

* Lesson: Basic ORM
* Lesson: Value Type Collections and Components
* Lesson: Entity Associations (Relations)
* Lesson: Mapping Inheritance

Session: Using Persistent Objects

* Lesson: Reading, Updating and Deleting Objects
* Lesson: Transactions

Session: Querying in Hibernate

* Lesson: Querying for Objects

Session: Review of the Spring Framework

* Lesson: The Spring Framework and IoC
* Lesson: Advanced Spring Container Features

Session: Spring Data Access Support

* Lesson: Overview
* Lesson: Spring JDBC
* Lesson: Spring Hibernate

Session: Spring AOP Framework

* Lesson: Spring AOP

Session: Web Frameworks

* Lesson: Spring and JSF (Optional)
* Lesson: Overview of SpringMVC (Optional)

Detailed overview
Introduction to Hibernate

Lesson: Introduction to Hibernate

* Define Object to Relational (O/R) Mapping (ORM)
* Define the Hibernate Architecture
* Illustrate the benefits of using Hibernate
* Understand the goals of Hibernate
* Understand key functionalities of Hibernate
* Define the different Hibernate types (Entities and values)
* Understand different Persistent representations (POJOs, Maps and XML)

Lesson: Getting started with Hibernate

* Understand the nuts and bolts of Hibernate
* Understand how to map a class to the database
* Understand the configurations involved and their relationships
* List different ways of configuring Hibernate
* Understand the overall syntax of the Hibernate Configuration file
* Understand the overall syntax of a mapping file
* Introduce the org.hibernate.SessionFactory
* Introduce the org.hibernate.Session
* Understand one way of obtain a session using Hibernate contextual sessions
* Supply a basic example of using Hibernate

ORM with Hibernate
Lesson: Basic ORM

* Configure persistent classes
* Configure persistent state of a class
* Understand the requirements for a persistent entity class
* Understand object identity in Hibernate
* Understand how to correctly implement equals and hashCode in Hibernate
* Discuss object identity and a caveat in hashCode and equals implementations
* Discuss different ways of generating unique numbers for keys
* Understand how to influence mapping to columns
* Understand how to map properties of a class to multiple tables

Lesson: Value Type Collections and Components

* Understand how to map composition using Hibernate's components
* Understand how to use components as composite identifiers
* Understand the different collection types supported
* List different element types: simple types, composite types and entities
* Understand programming restrictions when using collections
* Understand how to map java.util.Set and java.util.List
* Understand how to position elements explicitly in the List
* Understand how to map java.util.SortedSet
* Understand how to correctly use a Comparator
* Understand how to map a java.util.Map
* Understand how to map the key of the map
* Understand Hibernate's bags
* Introduce Dynamic components

Lesson: Entity Associations (Relations)

* List the different types of associations
* Understand the difference between uni and bidirectional associations
* Understand how to map unidirectional one to one, many to one and one to many associations
* Understand how and when to use join tables
* Understand how to map many-to-many associations
* Understand how to configure bidirectional associations
* Understand how to cascade over associations

Lesson: Mapping Inheritance

* Discuss the three Inheritance ORM strategies
* Discuss the Single Table Inheritance Pattern (i.e. table per class hierarchy)
* Discuss the Class Table Inheritance Pattern (i.e. table per subclass)
* Discuss the Concrete Table Inheritance Pattern (i.e. table per concrete class)
* Discuss Hibernate's implicit polymorphism strategy
* Understand how to configure these mappings
* Understand the concept of a discriminator

Using Persistent Objects
Lesson: Reading, Updating and Deleting Objects

* Understand the three object states: Transient, Persistent and Detached
* Understand how to transition from the transient to persistent state (i.e. how to make objects persistent)
* Understand how to retrieve hibernated objects using the primary key
* Understand how to retrieve hibernated objects using basic HQL
* Understand how to update entities which are in the persistent state (attached updates)
* Understand how to transition entities from persistent to detached state
* Understand the detached state of an entity
* Discuss the briefcase model
* Understand how to transition from detached (back) to persistent (i.e. how to re-attach detached objects)
* Understand the difference between update and merge
* Removing entities
* Discuss the different cascade options and their impact on entity associations

Lesson: Transactions

* Describe the need for transaction control
* Explain isolation levels
* Discuss the three different ways of demarcating transactions
* Understand the different ways of demarcating transactions in a managed Java EE environment
* Understand how to correctly use the contextual session
* Use the Hibernate Transaction API to hide transaction implementation
* Correctly handle exceptions
* Understand Optimistic -vs- Pessimistic locking schemes
* Implement Optimistic concurrency using Hibernate's automatic versioning
* Implement Pessimistic concurrency using Lock modes
* List different optimistic lock modes supported in Hibernate
* Understand locking using read for update
* Understand the read for update scope on association (and how to cascade the lock)

Querying in Hibernate
Lesson: Querying for Objects

* Introduce two ways of querying (Criteria and HQL)
* Understand the basic HQL syntax
* Introduce the org.hibernate.Query class
* Work with the results of a query
* Handle different result set element types (unique, array of entity, scalar)
* Use the relationships between entities in your HQL
* Use HQL expressions
* Use aggregate functions
* Use the group by clause
* Understand how to enable Pagination
* Use parametrized HQL
* Understand the concept of Named Queries
* Use the org.hibernate.Criteria to query
* Understand how to use Query By Example (QBE)

Review of the Spring Framework
Lesson: The Spring Framework and IoC

* Understand the value of Spring
* Explore IoC/DI
* Configuring collaborators
* Understand built-in property editors

Lesson: Advanced Spring Container Features

* Provide an overview of Spring's factory beans
* Re-use bean definitions in the configuration file
* Use placeholders in the configuration file
* Create custom property editors
* Become familiar with container post-processors

Spring Data Access Support
Lesson: Overview

* Understand the Spring DAO
* Understand Transaction Demarcation within Spring

Lesson: Spring JDBC

* Overview of Spring JDBC support
* Defining DataSources
* JDBC Exceptions and the SQLExceptionTranslater within Spring
* Creating JDBC DAOs
* Using the JdbcTemplate class
* Mapping rows to Objects using the JdbcTemplate
* Mapping data to Objects using SQL Helper Objects (Operation Classes)

Lesson: Spring Hibernate

* Overview of Spring Hibernate support
* Session and connection management
* Creating Hibernate DAOs
* Using the hibernateTemplate class

Spring AOP Framework
Lesson: Spring AOP

* AOP basics
* AOP support within Spring
* Understanding proxy factories

Web Frameworks
Lesson: Spring and JSF (Optional)

* Brief overview of JSF
* Understand the integration between JSF and Spring
* Understand bean resolution

Lesson: Overview of SpringMVC (Optional)

* Understand the architecture of Spring MVC
* Understand how to configure a Spring MVC web application
* Understand URL mapping in Spring MVC
* Understand Interceptor classes
* Understand View and ViewResolver classes
* Understand Controller classes
* Understand how to process a form request
* Understand how to add validation support to form processing
* Introduce Themes, exception handling, I18N support, web application testing and wizards

Hands-on lab exercises

1. Map a class (Member) to the database-The objective is to map a class with fields of different types to the database. This will also enable students to understand how to setup the environment.
2. Implement a Composition-The objective of this exercise is to understand how to use Hibernate's components
3. Implement Collections-The objective is to understand how to map different collections.
4. Map different associations-The objective is to map different association types to the database in two real-life use cases.
5. Map specializations-The objective is to understand how to map class inheritance to the database
6. Implement a service-per-request proxy and work with detached objects-The objective is to understand how to implement the service-per-request pattern and how to control the lifecycle of the detached entity.
7. Transactions and Concurrency-See the effect of optimistic and pessimistic concurrency and how to develop these schemas
8. Configuring Dependencies-Familiarization with the Spring configuration file
9. Advanced Configuration-Re-use bean definitions and make use of property files
10. Implementing the DAO Layer-Use the Spring DAO helper classes
11. Implement the MemberDAO using Spring and Hibernate-Use Spring's Hibernate classes
12. Spring IoC/AOP-To become familiar with Spring containers and Spring AOP
13. Use JSF and Spring-Create a front-end using JSF
14. Web Application using Spring MVC-To learn how to build a web application using Spring MVC, including forms and validation
 

Prerequisites
Developers and programmers who have working knowledge of Java P™P (J2SE) and who wish to enhance their skills in designing, developing, and deploying distributed, interoperable, multi-tier applications based on J2EE.

Recommended Follow-On Courses
There are no recommended follow on courses

Duration
5 days

Cost
£1,500 plus VAT

Recommended reading & follow on courses

Thinking in Java
ISBN-10: 0131872486


Testimonials

 


Who has been on this course before

Carmarthenshire County Council
Ultra Airport Systems