Instructor-led training
Fast Track to Spring Framework 3 and Hibernate Training in North Port, Florida
This is a demanding and full 5-day course that covers the Spring 3.0 and Hibernate 3 technologies.
What you'll learn
Private Training for Teams
This course is offered as private, instructor-led training for organizations, onsite in North Port, Florida or live online. Dates, delivery format, and course content are arranged around your team's requirements.
This course is not currently scheduled as a public class for individual enrollment.
Request Group TrainingPrerequisites
Course Outline
Introduction to Spring
The Challenge of Enterprise Applications
Shortcomings of Java/Java EE
What is Spring?
The Spring Modules
The Spring Distribution
Spring Introduction
Managing Beans
A Basic Spring Application
Some Bean Classes
Configuration Metadata
Declaring Beans
The Spring Container
Working with Spring
Why Bother?
Some BeanFactory Methods
Dependencies and Dependency Injection
Dependencies Between Objects
Dependency Inversion Principal
Dependency Injection (DI) in Spring
Dependency Injection Configuration
Advantages of Dependency Injection
Dependency Injection Reduces Coupling
More about Bean Properties
Working with Properties
Configuring Value Based Properties
Using Value Based Properties
Property Conversions
Constructor Injections
Constructor Argument Resolution
Setter Injection vs. Constructor Injection
Collection Valued Properties
Working with Collections
Configuring and
Configuring Collections of Bean References
Map Valued Properties
java.util.Properties Valued Properties
Additional Capabilities
Factory Methods
Instance Factory Methods
Bean Aliases
Bean Definition Inheritance
Autowiring
Autowiring byType
Pros and Cons of Autowiring
To Autowire or Not to Autowire
The Spring Container and API
ApplicationContext
Fast Track to Spring®3
and Hibernate
Fast Track to Spring 3 and Hibernate
ApplicationContext Interface
ApplicationContext Implementations
Constructors
Using an ApplicationContext
Spring Resource Access
Built-in Resource Implementations
Bean Scope and Lifecycle
Bean Scope
Specifying Bean Scope
Inner Beans
Compound Names
Depends On
Bean Creation Lifecycle
Bean Creation Lifecycle Details
Using the Lifecycle Interfaces for Beans
Bean Destruction Lifecycle
BeanPostProcessor
@PostConstruct and @PreDestroy
Event Handling
MessageSources
Issues with Messages
Resource Bundles
Defining Resource Bundles
Using Resource Bundles and MessageSource
Localization/Internationalization
Paramaterizing Messages
Annotation Driven Configuration
Annotations in Spring
Enabling Spring Annotations
@Component and Auto-Detecting Beans
DI Using @Resource
Complete Declarations Using Annotations
Other Stereotype Annotations
@Resource – Additional Uses
@AutoWired
Qualifiers
Lifecycle Annotations
XML Config – Annotations and Scanning
Annotation Configuration – Pro/Con
A Note on the XML Configuration
A Brief Note on Annotations
Other Capabilities
SpEL – Spring Expression Language
Other SpEL Capabilities
Validation
Using Validation
Configuring Validation
Validation Constraints
Additional Capabilities
Database Access with Spring
Issues with JDBC
Problems Using JDBC Directly
Let’s Review Some Simple JDBC Usage
Simple Query on the Database
Problems with the Previous Approach
Spring Support for the DAO Pattern
Spring DAO Support
The Spring Database API
The JdbcTemplate Class
The JdbcDaoSupport Class
DataSources
Spring Jdbc Exception Hierarchy
DAO Based on Spring Classes
Configuring a DataSource
Looking up a DataSource in JNDI
Building a DAO without the Support Class
Queries and Updates
Querying with JdbcTemplate
Mapping Result Rows to Objects
Defining a RowMapper Class
Inserting/Updating
Other Kinds of Query Methods
The SimpleJdbcTemplate
The SimpleJdbcTemplate Class
Introduction to Hibernate
Hibernate Overview
The Issues with Persistence Layers
Object-Relational Mapping (ORM) Issues
Issues with JDBC Alone
Hibernate Benefits
Hibernate Environments
Hibernate Architecture
More Detailed Architecture
Using Hibernate
Acquiring Hibernate
Configuring Hibernate
Fast Track to Spring 3 and Hibernate
Hibernate.cfg.xml Elements
SessionFactory Configuration
The Configuration Class
The SessionFactory Interface
SessionFactory API
The Session Interface
Sessions and Transactions
Mapping a Simple Class
Persistent Entity Classes
Persistent Classes
The Event Class
The id Property
The Hibernate Mapping File
The
The
The EVENTS Table
Mapping the id Property with
More About Primary Keys
Generating the id Value
Mapping Properties with
Hibernate Mapping Types
Common Hibernate Type Mappings
Field Access or Property Access
The Mapping File
Hibernate Sessions
The Session Interface
Retrieving Persistent Objects
Logging
Hibernate.show_sql
Simple Logging Façade for Java-SLF4J
Apache Log4J
Hibernate log4j.properties file
The log4j.properties file
Modifying log4j.properties for Hibernate
Hibernate Logging Categories
Spring / Hibernate Integration
Contextual Sessions
Session Propagation
First-Acquiring a SessionFactory Instance
Contextual Session
Using Contextual Sessions
What is the “Current” Context
Contextual Session Scope
Spring/Hibernate Integration
Spring Support for Hibernate
LocalSessionFactoryBean
Spring Configuration of SessionFactory
Spring Free DAO
HibernateDAOSupport
Querying with HibernateTemplate
Updates and Queries
Inserting and Updating
Inserting Instances
Modifying a Persistent Instance
Deleting an Instance
Querying and Hibernate Query Language (HQL)
HQL Basics
Executing a Query
Other Common Query Methods
Where Clause / Restriction
HQL Operators and Expressions
Query Parameters
Using Query Parameters
Named Queries
Projection Queries
Aggregate Functions
Transactions
Hibernate Transactions
Transaction Lifecycle
Hibernate and Transactions
Hibernate Transaction Demarcation
Working with Transactions
The Hibernate Transaction API
Working in a Managed Environment
Sprig Transaction Management
Transaction Managers
Configuring Transaction Managers
Spring Transactions and Hibernate
JTA Transaction Manager
Spring Declarative Transaction Management
Transactional Scope
Transaction Attributes for Propagation
MANDATORY
NESTED
NEVER
NOT_SUPPORTED
REQUIRED
REQUIRES_NEW
SUPPORTS
Fast Track to Spring 3 and Hibernate
Transaction Attributes
Rolling Back and Exceptions
Spring Proxies and Direct Invocation
[Optional] Spring Transactions - XML Configuration
Lifecycle
The Persistence Lifecycle
Hibernate Object States
Transient and Persistent State
Detached and Removed State
Hibernate Object States and Transitions
The Persistence Context
The Persistence Context as Cache
Synchronization to the Database
Flushing the Session
Persistence Context and Object Identity
Yes, It’s Complicated
Versioning and Optimistic Locking
Using a Detached Instance
Optimistic Locking and Versioning
Version Property in Java Class
Version Element in Mapping File
Automatic Version Maintenance
Updating a Detached Instance
Session.saveOrUpdate()
The unsaved-value Attribute
Locking Objects
Common Lock Modes
Relationships
Object Relationships
Characteristics of Relationships
Directionality
Collections of Value Objects
Modeling a Set of Values
Mapping the Set of Values
Using a Set of Values
More on the Java Collection Type
Using the Java Collection Types
Modeling a List of Values
Mapping a List of Values
Sorted and Ordered Collections
Collections of Components
Mapping Collections of Components
Mapping Entity Relationships
Inheritance
Entity Inheritance
Details of Entity Inheritance
Single-Table Strategy
Class Definitions for Single-Table
Mapping for Single-Table
Sample Table Entries
Single-Table: Pros and Cons
Table per Subclass (Joined Subclass)
Mapping for Table per Subclass
Joined: Pros and Cons
Table per Concrete Class
Spring and the Web
Spring and Java EE
Java EE Web Applications
Web Application Structure
Web Application Components
ApplicationContext and Web Apps
Configuring ContextLoaderListener
Using the Application Context
Additional Hibernate Topics
equals() and hashCode()
Defining equals() and hashCode()
Redefining equals()
Caching
Second-Level Cache
Data Appropriate for Caching
Cache Providers
Configuring Caching
Concurrency Strategies
Managing the Caches
Design Considerations
Long Conversations
Session-Per-Conversation
Problems with Web Applications
Open Session In View Pattern
Query Efficiency Techniques
Beware of n+1 Select Issue
Prefetching Data in Batches
Data Access Object (DAO)
Hibernate and the Java Persistence API (JPA)
JPA Persistence API Overview
Java Persistence Environments
Hibernate and JPA
Mapping a Simple Class
Entity Classes
Event Entity Mapped with JPA
Fast Track to Spring 3 and Hibernate
javax.persistence.Entity Annotation
The Event Class
The Id Property
Mapping Properties
Basic Mapping Types
Entity Manager and Persistence Context
The Entity Manager & Persistence Context
Persistence Unit
persistence.xml
Acquiring an EntityManager
Working with Transactions
Retrieving Persistent Objects
Inserts and Queries
Persisting a New Entity
Java Persistence Query Language
Executing a Query
WHERE Clause and Query Parameters
Named Queries
Version Property in Java Class
Versioned Class and Detached Objects
Relationships
JPA Support for Relationships
Mapping the Many-To-One Relationship
Mapping the One-To-Many Relationship
Loading and Cascading
Queries Across Relationships
Inheritance
Entity Definitions for Single-Table
Entity Definitions for Joined
Recap
Resources for More Learning
Why Spring and Hibernate are hard to learn together
Both frameworks take work out of your code and give it to a runtime. Spring creates, wires and proxies your objects. Hibernate tracks your entities and decides when to write SQL. Many failures therefore show up at startup or at runtime, not in the code you are reading. The syllabus builds the topics in dependency order.
- Container and DI. It begins with the motivation for Spring and the Dependency Inversion Principle, then bean configuration metadata, constructor versus setter injection, collection-valued properties, bean scope and lifecycle, and autowiring byType with its stated pros and cons. Annotation-driven configuration (@Component, @Resource, @Autowired, qualifiers, @PostConstruct/@PreDestroy), SpEL and validation follow.
- Data access. JdbcTemplate, JdbcDaoSupport, DataSource configuration and the Spring JDBC exception hierarchy show what the framework removes from raw JDBC.
- Hibernate and integration. Hibernate mapping and sessions come next, then Spring integration through LocalSessionFactoryBean and contextual sessions, so DAOs stay free of Spring classes.
- Transactions. Declarative transactions cover @Transactional, the propagation attributes (REQUIRED, REQUIRES_NEW, NESTED and the rest), and rollback rules.
Several misconceptions cause most of the trouble:
- Declarative transactions. They are applied through proxies, which is why the syllabus covers "Spring Proxies and Direct Invocation." A call that does not pass through the proxy may not start a transaction at all.
- Persistence context. It acts as a cache, flushes on its own schedule, and affects object identity. The syllabus itself says "Yes, It's Complicated" on this topic. Transient, persistent, detached and removed states, saveOrUpdate() and optimistic locking with a version property all depend on it.
- Entity design and performance. equals()/hashCode() on entities, the n+1 select problem, batch prefetching, second-level cache concurrency strategies and Open Session In View all need an understanding of when queries actually run.
Who this course suits and what to take around it
The course is labeled introductory because it introduces both frameworks, but the prerequisites are real: a good working knowledge of Java, interfaces and JDBC. You need JDBC in particular, because the data access section starts by contrasting raw JDBC with JdbcTemplate. It fits developers and technical leads who build or maintain Java back-end code that uses Spring and Hibernate together. It also suits teams that want one shared vocabulary for DI, mapping and transactions. If Java fundamentals are not yet solid, start with the Java Programming courses and learning guide.
The web material here is limited to Spring in a Java EE web application: the ApplicationContext and ContextLoaderListener. For the web layer, the Fast Track to Spring Framework 3.x and Spring Framework MVC/REST course is a natural next step, since this course does not teach MVC controllers or REST endpoints.
If a team needs only the container and Spring JDBC without Hibernate, the Fast Track to Spring Framework 3.x course is the shorter, Spring-only option. Organizations on other framework releases can ask for private training tailored to the versions they use through a training proposal.
Illustrative scenarios
The scenarios below are illustrations of how the course material can be applied. They are not descriptions of specific organizations or of the course's lab exercises.
- Replacing hand-written JDBC in a legacy DAO layer. A team might have DAOs that open connections, loop over result sets and catch SQLException everywhere. The syllabus topics map onto the cleanup: a DataSource configured as a bean or looked up in JNDI, JdbcTemplate with RowMapper classes, and the Spring JDBC exception hierarchy in place of checked exceptions.
- Making a multi-step update safe. For example, a service updates an account and writes an audit record, and the audit write must survive a rollback of the main work. That calls for the propagation attributes (REQUIRES_NEW versus REQUIRED), rollback rules for exceptions, and awareness of proxy behavior on internal calls. If two users edit the same detached entity, a version property with optimistic locking prevents silent overwrites.
- Diagnosing a slow listing page. A page that loads a parent entity and then one query per child is the n+1 select pattern. The syllabus topics for it are Hibernate logging and show_sql, HQL queries, batch prefetching, second-level cache choices and the session-per-conversation and Open Session In View design considerations. The same team might also look at how the entity model would map under JPA annotations and an EntityManager.
Using AI coding assistants with these topics
AI coding assistants are useful for boilerplate here: bean definitions, DAO skeletons, mapping files or annotations, simple HQL, and first drafts of JUnit tests. They are less reliable on the points this course teaches as hard:
- Version mixing. Generated code often blends styles and APIs from different framework generations, such as annotation configuration with template-based DAOs, or the wrong session acquisition approach for the project. Check every import and API against the versions your project actually builds with.
- Transaction placement. Assistants may put @Transactional where the proxy never applies, or ignore rollback rules for checked exceptions. Test that a failure really rolls back and that propagation behaves as intended.
- Entity details. Generated entities frequently have naive equals()/hashCode(), unplanned lazy-loading access outside a session, or fetch settings that cause n+1 queries. These problems do not show up in the code itself.
- Injection and security. Assistants sometimes concatenate strings into queries instead of using query parameters.
To verify, turn on Hibernate SQL logging and count the statements for a typical request. Run transactional code against a test database with forced failures. Review autowiring ambiguities and bean scopes by hand. Treat generated mappings as a draft until you can explain each association and lifecycle transition in them.
Frequently asked questions
What level is this course and what do I need beforehand?
It is an introductory course on Spring and Hibernate, but it assumes a good working knowledge of basic Java programming, interfaces and JDBC. The pace is intensive, so comfort with core Java is important.
What does the course cover?
The Spring container and dependency injection (XML and annotation-based), bean scope and lifecycle, message sources, SpEL and validation, Spring JDBC support, Hibernate mapping, sessions, HQL, Spring/Hibernate integration, declarative transactions, the persistence lifecycle, optimistic locking, collections, relationships, inheritance mapping, caching and query efficiency. It ends with Hibernate used through the Java Persistence API (EntityManager, persistence.xml, JPQL).
Does it cover Spring MVC or building web applications?
Only the Spring bootstrapping of a Java EE web application (ApplicationContext and ContextLoaderListener). Controllers, views and REST endpoints are not in the syllabus.
Can this be delivered privately for our team, onsite or online?
Yes. HSG provides private training for organizations, delivered onsite at your location or live online.
Can the content be customized?
Private course content can be customized, including tailoring to the technology versions your organization uses. You can describe your needs through a training proposal request.
Training locations
Fast Track to Spring Framework 3 and Hibernate training across the U.S. and beyond.
We provide private Fast Track to Spring Framework 3 and Hibernate training for organizations, onsite at your location or live online, throughout the United States and internationally.
View all Fast Track to Spring Framework 3 and Hibernate training locations
Train your team with HSG
Private, instructor-led training customized for your organization.
- Onsite or live online delivery
- Customized curriculum
- For a single employee or an entire team
- Flexible scheduling
- Experienced instructors
Questions? Call us at 303.377.6176
or email info@hartmannsoftware.com
Ready to train your team?
Let's customize this training for your organization.
Tell us about your employees, your goals, and your preferred schedule. We'll prepare a training proposal covering scope, delivery format, and pricing.