Learn your way! Get started

Java EE: Integrating Hibernate and Spring 3.0

with expert Greg Matus


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 6/17/2011
Level Advanced
Runtime 11h 24m
Closed captioning N/A
Transcript N/A
eBooks / courseware Included
Hands-on labs Included
Sample code Included
Exams Included


Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

As data models get more complex it becomes harder for programmers to create applications to access that data. Enter Java Hibernate. Hibernate is a middle-tier developer framework for Object to Relational Mapping (ORM). A Hibernate tier is used as a go-between from the data tier to the client tier thus creating an automatic translation between the Object Oriented model and the required relational data model. This course will take the next step by showing you the higher functions of Hibernate like Mapping Inheritance, Annotations and Composite keys. You will then move on to Transactions and Querying, then Spring Hibernate Integration foundation and end with using Hibernate in Spring.

Prerequisites

The students should be familiar with object-oriented principals and have a solid practical understanding of polymorphism in Java. They must also have a working knowledge of Eclipse IDE for JavaEE.

Learning Paths

This course is part of the following LearnNowOnline SuccessPaths™:
Java Development

Meet the expert

Greg Matus combines his practical programming skills and mentoring excellence to develop the highest quality educational programs available. His technical focus includes developing programs and projects focused around advanced application development, performance, and tuning skills and technologies. His specialties include Java, advanced J2EE / JEE, AJAX, XML, Web Services, JSP, SQL, JDBC and Database topics, Oracle, Eclipse, WebLogic, and more.

Course outline



Inheritance Mapping

Mapping Inheritance (46:36)
  • Introduction (02:29)
  • Inheritance Mapping (02:30)
  • Patterns for Mapping Inheritance (03:11)
  • Single Table Inheritance (10:35)
  • Class Table Inheritance (08:11)
  • Concrete Table Inheritance (08:23)
  • Inheritance and Proxy Caveats (10:49)
  • Summary (00:24)

Working with Mapping

Mapping Inheritance B (01:06:42)
  • Introduction (00:27)
  • Demo: Mapping with Code (02:50)
  • Demo: Mapping Subclasses (27:41)
  • Demo: Running Test Client (35:25)
  • Summary (00:17)

Hibernate Annotations

Hibernate Annotations (01:13:11)
  • Introduction (00:39)
  • Annotations Overview (02:14)
  • Hibernate Annotations Overview (02:09)
  • Setting Up to Use Annotations (01:02)
  • Annotation Drawbacks Benefits (04:02)
  • Getting to Hibernate Annotations (02:28)
  • Declaring Persistence (10:57)
  • Generating Primary Keys (02:12)
  • Primary Key Annotation Examples (02:29)
  • @SequenceGenerator (02:37)
  • @TableGenerator (01:23)
  • Compound Primary Keys (01:53)
  • Compound-Primary-Key Class (01:44)
  • Declaring Compund PK Class (01:42)
  • Nested Classes (03:09)
  • Compound Primary Key Examples (02:13)
  • Client-Code for Compound PK (01:23)
  • Mapping Relationships (02:02)
  • Demo: Annotations (17:40)
  • Demo: Testing (08:32)
  • Summary (00:31)
Annotations Composite Keys (16:45)
  • Introduction (00:28)
  • Demo: Mapping (08:37)
  • Demo: Test Client (07:06)
  • Summary (00:32)

Reading, Updating and Deleting

Reading Updating and Deleting (01:19:21)
  • Introduction (00:32)
  • Session Scope (16:57)
  • Important Session Methods (18:27)
  • States (12:25)
  • Transient to Persistent (07:36)
  • Hibernated to Persistent (11:03)
  • Detached to Persistent (11:55)
  • Summary (00:23)

Manipulating Data

Reading Updating and Deleting (50:05)
  • Introduction (00:39)
  • Demo: Session-per-Request (09:15)
  • Demo: InvocationHandler (10:06)
  • Demo: Exceptions (07:33)
  • Demo: Member DAO Class (10:28)
  • Demo: Run Client (11:42)
  • Summary (00:21)

Transactions

Transactions (01:17:55)
  • Introduction (00:41)
  • Transactions (08:30)
  • Framework-Managed Transactions (03:43)
  • Isolation Levels (09:50)
  • Demarcating Transactions (02:23)
  • Managed Environments Need Config. (01:37)
  • Demarcating Transactions (05:46)
  • Concurrency (11:40)
  • Optimistic Locking-Versioning (02:02)
  • Pessimistic Locking (00:47)
  • Pessimistic Locking Levels (01:59)
  • Pessimistic Locking Example (03:21)
  • Demo: Hibernate Transactions (10:25)
  • Demo: Effects on Objects (11:31)
  • Demo: Running Test (03:05)
  • Summary (00:26)

Querying for Objects

Querying For Objects (01:15:34)
  • Introduction (00:34)
  • Hibernate Querying (11:13)
  • Hibernate Type Implementations (04:39)
  • Hibernate Query Language (01:28)
  • The from Clause (02:13)
  • Associations and Joins (04:06)
  • HQL select Clause (08:23)
  • HQL where Clause (03:02)
  • HQL Aggregate Functions (04:06)
  • Expressions (02:20)
  • order by and group by Clauses (02:21)
  • Pagination (05:07)
  • The Criteria API (03:13)
  • org.hibernate.criterion.Restrictions (09:14)
  • org.hibernate.criterion.Order (07:39)
  • org.hibernate.criterion.Projections (03:25)
  • Detached Queries (01:46)
  • Summary (00:36)

Working with Objects

Querying for Objects B (41:44)
  • Introduction (00:31)
  • Demo: Basic Querying (08:53)
  • Demo: Run Test Query Client (04:46)
  • Demo: Querying Using Parameter (08:08)
  • Demo: Using Criteria Object (05:55)
  • Demo: Addresses Using SQL (12:57)
  • Summary (00:30)

Spring Hibernate Integration

Spring Hibernate Integration (01:07:25)
  • Introduction (00:48)
  • Data Access Support (02:01)
  • DAO Implementations (04:34)
  • Transaction Support (08:57)
  • Isolation Level Concepts (03:55)
  • Isolation Level Constants (02:00)
  • Propogation Behavior Constants (04:50)
  • Transaction Management (00:33)
  • Transaction Configuration (00:42)
  • Programmatic Transaction (03:09)
  • Spring - Declarative Transactions (03:47)
  • Benefits of Declarative Transactions (07:07)
  • Forms of Declarative Transactions (02:06)
  • Using the Spring Config File (08:03)
  • The Java Code is Simple (01:48)
  • Configuring the Transaction (03:47)
  • Using @Transactional Annotation (03:38)
  • Declarative Annotations (05:03)
  • Summary (00:29)

Building Solutions

Using Hibernate in Spring (01:28:42)
  • Introduction (00:42)
  • Intro (01:55)
  • Benefits of Using Spring (03:29)
  • Configuring Hibernate in Spring (04:01)
  • Using Hibernate in Spring (03:56)
  • Transaction Management (02:34)
  • Open Session in View (09:15)
  • Demo: Configuring Hibernate (28:54)
  • Demo: Test and Run (27:50)
  • Demo: Recap (05:34)
  • Summary (00:28)