Instructor-led training
Introduction to Spring 5 and JPA2 Training in Raytown, Missouri
This course includes coverage of all the core Spring 5 and JPA 2 capabilities, as well as the integration capabilities provided by Spring.
What you'll learn
Private Training for Teams
This course is offered as private, instructor-led training for organizations, onsite in Raytown, Missouri 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
What makes Spring and JPA hard to learn together
Basic Java is enough to read the code in this course. The harder part is that two frameworks now control behavior your code never states explicitly. Spring creates and wires your objects. JPA tracks and writes your data. Many mistakes only show up at startup or when a transaction commits.
The syllabus builds the layers in this order:
- Container and configuration (sessions 1-3). Beans, ApplicationContexts and dependency injection come first, using XML, @Component and @Autowired. Then come @Configuration and @Bean, @Import, scopes, lifecycle callbacks, @Value, SpEL and profiles. A common misconception is that one style is correct. The course compares the pros and cons of each and how to combine them. Spring Boot parents and starters are introduced for dependency management.
- Testing (session 4). JUnit fundamentals and the Spring TestContext Framework give you a way to check the later material.
- JPA core (sessions 5, 7, 9). Entity mapping, the EntityManager and persistence units lead into JPQL. The entity states (new, managed, detached, removed) and persistence context synchronization are the hardest ideas. They explain why a change is saved without an explicit call, or is silently lost on a detached instance. @Version and optimistic locking build on the same concepts.
- Integration and transactions (sessions 6, 8, 11). Container-managed EntityManagers, @PersistenceContext, @Transactional, propagation and the Open EntityManager in View pattern. Learners often assume @Transactional always applies. In practice, scope and propagation settings decide what actually happens.
- Relationships and Spring Data (sessions 10, 12). Owning versus inverse sides, cascading, lazy versus eager loading, fetch joins, three inheritance strategies, then CrudRepository and query-by-naming-convention. Spring Data is easier to debug once you know the JPA behavior beneath it.
The course uses Java SE 8, including Java 8 date/time mapping. Java SE 8 is in Extended Support only, with support through December 2030.
Who it suits and what to take around it
This is an introductory, five-day course for Java developers who know the language but are new to Spring, JPA or both. It also suits teams that maintain XML-configured applications and need to understand @Configuration and annotation-based alternatives. Basic Java is the stated prerequisite. If your team needs a Java refresher first, start from the Java Programming courses and learning guide.
After this course, two directions follow naturally:
- Teams working in a Java EE application server may want the container-managed view of the same persistence concepts. Fast Track to EJB 3.2 (JEE 7 level) and JPA2 pairs JPA with EJB, which suits teams that use both models.
- This syllabus covers Spring's web integration with Java EE web apps but does not cover building HTTP APIs. For that, Developing RESTful Services Using Java is the logical next step.
Organizations on other Java, Spring or JPA versions can ask for private training tailored to the versions they run. Request a training proposal to discuss it.
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.
- Consolidating configuration. A team might inherit an application with XML bean definitions and newer annotated classes side by side. The sessions on integrating configuration types, @Import and <import>, and profiles apply directly. They help the team externalize environment-specific properties and settle on one style.
- Fixing a slow order screen. For example, a page that lists customers and their orders might trigger one query per row. Relationship mapping, lazy versus eager loading and fetch joins explain the cause. Open EntityManager in View explains why lazy loading failed or succeeded in the web tier. Rewriting the query with a fetch join is the fix.
- Replacing hand-written DAOs. A team maintaining several JPA repository beans built on @PersistenceContext might move simple lookups to Spring Data. Naming-convention queries and CrudRepository cover those. Custom JPQL, named queries and @Transactional boundaries stay in place for complex cases, with TestContext-based tests guarding the change.
Using AI coding assistants with Spring and JPA
AI coding assistants are useful for boilerplate here. They can draft @Configuration classes, entity mappings with @Id and @Column, Spring Data repository interfaces and JUnit test skeletons. They can also explain unfamiliar XML configuration. Teams get the most from them after learning the concepts, because only then can they judge the output.
They tend to fail on behavior that depends on runtime state rather than syntax:
- Version drift. Generated code may use APIs or configuration idioms from other framework releases than your project. Check imports and dependencies against your actual Spring and Java versions.
- Transactions. Suggested @Transactional placement may ignore propagation and scope, or put the boundary where the proxy never applies it.
- Entity design. Common errors include missing or wrong equals() and hashCode(), the wrong owning side on a bidirectional relationship, unsafe cascading, and eager fetching that hides N+1 queries.
- Mixed configuration. Assistants may blend XML, component scanning and @Bean definitions so that beans are defined twice or the wrong profile is active.
To verify, turn on provider-based SQL logging and count the statements a use case issues. Write TestContext tests that load the real configuration and exercise transaction boundaries. Check entity state transitions explicitly, including detached instances and @Version conflicts. Review every generated mapping against the table structure it produces.
Frequently asked questions
What level is this course and what do I need beforehand?
It is introductory. The prerequisite is basic Java. No prior Spring or JPA experience is assumed, though some familiarity with relational databases and SQL helps with the JPQL and mapping sessions.
What does the course cover?
It covers Spring container and dependency injection, Java, annotation and XML configuration, scopes, profiles, Spring Boot dependency management, JUnit and the Spring TestContext Framework, JPA mapping and the EntityManager, JPQL, transactions, the entity lifecycle and optimistic locking, relationships and inheritance mapping, Spring web integration, and Spring Data repositories.
Does the course cover building web or REST applications?
It covers integrating Spring with Java EE web apps, including ContextLoaderListener, WebApplicationContext and Open EntityManager in View. It does not teach building REST services. A separate RESTful services course covers that.
Can this be delivered privately for our team, onsite or online?
Yes. HSG delivers private training for organizations at the client's location or live online.
Can the content be customized?
Yes. Private training can be tailored to the technology versions and topics an organization uses. Submit a training proposal request to discuss your needs.
Training locations
Introduction to Spring 5 and JPA2 training across the U.S. and beyond.
We provide private Introduction to Spring 5 and JPA2 training for organizations, onsite at your location or live online, throughout the United States and internationally.
View all Introduction to Spring 5 and JPA2 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.