Development Using Spring and Hibernate Course

Course Code: IN 549
Course Abstract: This course provides participants with in-depth coverage and hands-on practical exercises using the latest features of the Spring and Hibernate frameworks.  Participants will begin by learning how to configure the Spring environment, wire up beans, and implement the powerful inversion of control (IOC) features that have made Spring so popular.  Participants will also learn to make use of Spring's aspect-oriented programming feature set, first by learning AOP basics and then applying those concepts within a Spring-enabled environment.  The built-in Spring MVC architecture will also be explored.   Also, Spring remoting and web service features will be examined.  Participants will learn how to map Java objects to relational data while exploring the transaction and persistence management features built into the Hibernate framework.   Participants will examine the built-in and customizable Hibernate mapping types as well as the Hibernate Query Language (HQL), an object-oriented SQL-like querying language.  Advanced Hibernate storing and fetching techniques are looked at also.  Integration into the Spring Framework and into other frameworks, such as Struts, are also explored via lectures and exercises.
 
Upon completion of this course participants will have developed a complete application using Spring and Hibernate-based enterprise APIs.  Hands-on labs reinforce the lecture topics while providing practical experience.  Emphasis is placed on the Spring IOC and AOP capabilities, Hibernate APIs, mapping features, and application integration.
Audience:

This course is designed for Java EE developers looking to explore Java's most promising open-source frameworks available today.  Experience with Java EE technologies is extremely helpful in deriving the most benefit from this course, though it is not required.

Duration: 5 days
Learning Outcomes: Upon completion of this course, the participant will be able to:
>Configure a Spring-based application using XML and the Application Context
>Wire up beans and understand Spring's inversion of control container
>Learn AOP basics and incorporate before, after, and around advice into a Spring application
>Configure the Hibernate persistence service for use within an application
>Incorporate various object-relational mappings and Hibernate typing
>Utilize the HQL, externalize and parameterize queries
>Explore the Hibernate API including transactions and caching techniques
>Seamlessly integrate Hibernate into the Spring Framework by developing a sophisticated data access object and business service architecture
>Utilize other Spring services including remoting, web services, and Spring MVC
Course Topics: Introducing Spring
Problems with traditional Java EE Development
What is Spring?
Spring Versions and Compatibility
The Traditional Development Approach
Introducing Dependency Injection
A First Look at Spring
A Spring Example
The Spring Distribution and JARs
Spring Configuration
The Spring Modules
Exercise 1 – Working with Spring
 
Inversion of Control
Spring IOC
Types of Dependency Injection
Setter Injection
Constructor Injection
Injecting Beans into Other Beans (“Wiring Up” Beans)
Spring Configuration files
Differences between Spring 2.0 and Spring 1.2.x
The Element
Spring 2.0 scopes
Scope vs. Singleton attributes
Bean Singletons
Bean Prototypes
Spring BeanFactories
ApplicationContext
Creating the Container
Building Spring Services
Exercise 2 – Creating Spring Services
Bean Scopes in Spring 2.0
Request and Session-scoped Beans
Steps toward Spring-enabling Your Web Applications
Using Request/Session-scoped beans within Singleton Services
Using Placeholders
Internationalization
Lookup Method Injection
Lazy Initialization
Autowiring
Controlling Bean Lifecycles
Exercise 2b – Spring-enable the Web Application
 
Spring JDBC
Why use Spring JDBC?
What does Spring JDBC offer?
JDBCTemplate
JDBCDaoSupport
Configuring the DataSource
Building a Spring-based DAO
Building a Row Mapper
Retrieving a Single Object
Spring JDBC Error Handling
DataAccessExceptions
Updates with JDBCTemplate
Updates via SQLUpdate
Exercise 3 – Retrieving and Updating Objects Using Spring JDBC
 
Introducing Hibernate
Has JDBC Failed?
JPA and Hibernate 3
Choosing a Persistence Strategy
Objects vs. Relations
Lightweight Services vs. Heavyweight Containers
How Hibernate Works
Within an Application Server
Persisting Plain Old Java Objects (POJOs)
Introducing the Hibernate Persistence Service
Getting Started with Hibernate
Setting up the Environment
hibernate.properties
Basic Configuration and Persistence Objects
Hibernate Mappings
Mapping Properties
Configuring the SessionFactory
Maintaining the Session Factory
A First Hibernate Example
Performing a Query
What is a Session?
Returning Multiple Rows
Executing Updates
Insert and Delete Operations with Hibernate
Configuring Log4J within Hibernate
Eclipse and Hibernate Plug-ins
Exercise 4 – Displaying, Inserting, Removing Products and Orders
 
The Hibernate API
Basic Configuration
The SessionFactory
A Hibernate Session
The Session Interface
Hibernate Exceptions
The LifeCycle of a POJO
Transient, Persistent, and Detached Objects
Session State Methods
Session Persistence Methods
First-Level Caching
Saving Duplicate Objects
Checking the Cache and Evicting
Loading Objects
Get() versus Load()
Mapping Associations
Cascading Operations
Composite Keys
Exercise 5 – Using Composite Keys and Associations
 
The Hibernate API – Part II
The Query Interface
Performing Queries
Query Methods
Iterating a Query
Iterating vs. Lists
Selecting Multiple Columns
Using HQL
Basic Syntax
Ordering and Grouping
HQL and Object Graphs
Maps and Functions in HQL
HQL Joins and Subqueries
Named Parameters
Positional Parameters
Pagination
Externalizing Queries
Stored Procedures
Lazy Loading
Working with Detached Object Graphs
Exercise 6 – Using HQL, Named Parameters, and Externalized Queries
 
More On Hibernate Mapping
Mapping Associations
Many-to-One
One-to-One
Directionality
Bi-directional Associations
Collections Mapping
Collection Types
Many-to-many Mappings
Unidirectional One-to-Many Lists
One-to-Many Bags
More on Types
Mapping Types
Hibernate and XDoclet
Exercise 7 – Querying and Updating with Many-to-Many Mappings
 
Transactions and Caching
Dealing with Concurrency
Hibernate Transactions
Configuring Transaction Type
Working with the JTA
Data Isolation Issues
Managing Transaction Isolation
Locking Strategies
Using LockMode
Hibernate LockMode Object
Automatic Versioning
First-Level Caching
Second-Level Caching
Configuring and Mapping Second Level Caches
Performance
Exercise 8 – Working with a Second-Level Cache
 
Integrating Frameworks and Patterns of Usage
DAO Patterns
Wrapping Hibernate
An Abstract DAO
Spring Meets Hibernate
Spring’s HibernateTemplate
Configuring Spring to Support Hibernate
Configuring the SessionFactory within Spring
Spring’s HibernateDaoSupport Class
A Hybrid Spring/Hibernate DAO
Using the New DAO
Spring-Enabling Web Apps
Spring-Enabling Struts Apps
IOC and Struts Actions
Replacing the RequestProcessor and Injecting Actions
Patterns of Usage for Hibernate Sessions in Web Apps
Exercise 9 – Utilizing the Spring/Hibernate DAO in a Struts App
 
AOP
Why Aspect-Oriented Programming?
Programming the Spring AOP Way
Common Terms
Recognizing Concerns
Weaving
Aspects
Aspect Structure
Join Points
Pointcuts
Advice
Introductions
Installing AspectJ
Aspects
AspectJ vs. Spring AOP
Exercise 10 – Creating and Utilizing AspectJ Aspects
 
Spring AOP
SpringAOP Basics
Using Before Advice
MethodBeforeAdvice Interface
Configuring Advice
Running the Client
Using After Advice
AfterReturningAdvice Interface
Around Advice
MethodInterceptor
Spring AOP Proxies
Client’s and the Proxy
Programmatic vs. Declarative Proxies
Pointcuts
Spring-Provided Pointcuts
Creating Pointcuts
Creating Advisors
Exercise 11 – Working with Spring AOP Around Advice for Data Validation
Spring MVC
The Spring MVC Process
Spring MVC Components
Spring MVC and Dependency Injection
Configuring the DispatcherServlet
Return of the ApplicationContext
Working with Spring Controllers
Defining HandlerMappings
What is a ModelAndView?
Configuring ViewResolvers
Spring JSP Tags and Data Binding
Data Validation: Jakarta Commons vs. Valang
Creating a Validator
Integrating different views: JSF, Struts, Tiles, etc.
Spring Web Flow
Spring Web Flow Actions
Configuring Web Flows
Transitions and Decisions
Managing Flow Execution
Exercise 12 – Creating the Product Spring MVC Application
 
Spring Remoting and Distributed Services
Integrating Spring and EJBs
Wiring EJBs
Enterprise Solutions with Spring and EJBs
Remoting with Spring
Created a Distributed App using Spring Remoting
Wiring Web Services
Exercise 13 – Utilizing Spring Remoting
 
Appendix A - Additional Spring and Hibernate Utilities
Spring IDE and Plug-ins
 
Appendix B – SQL Basics
Prerequisites:
Previous Java EE, XML, and Java skills are required. This course is recommended for participants who have previously had exposure to Java EE application components or are comfortable with Java SE and Java EE development principles.
 
 
Note: All fields are required
At the present time we do not offer training for individuals or groups less then 6 individuals. We apologize for any inconvenience.


We Value Your Privacy!

Ready to get started or in need of more information? Contact us today.

Go To Blog Virtual Learning