Learn your way! Get started

Java EE Programming: Hibernate

with expert Greg Matus


Course at a glance

Included in these subscriptions:

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

Release date 5/27/2011
Level Intermediate
Runtime 14h 5m
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 start you on the journey to understand Hibernate. First, you will cover the basics of what Hibernate is and what it does. Next, move to ORM and persistence in class mappings and many other items. Then you will see Value types, components and Collections and finish up with Entity Associations.

Prerequisites

This course assumes you are familiar with object-oriented principals and have a solid practical understanding of polymorphism in Java. You must also have a working knowledge of Eclipse IDE for Java EE.

Learning Paths

This course will help you prepare for the following certification and exam:
Java EE 6 Java Persistence API Developer
1Z0-898: Java EE 6 Java Persistence API Developer Certified Expert Exam

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



Overview

Hibernate Intro (36:18)
  • Introduction (02:07)
  • Hibernate ORM (06:03)
  • Hibernate Approaches (01:20)
  • Hibernate Uses Lazy Loading (03:06)
  • ORM Without Lazy Loading (02:40)
  • Benefits of Using Hibernate (04:18)
  • Example of Lazy Loading (01:51)
  • Loading an Entire Object Graph (03:30)
  • Hibernate Supports Caching (03:18)
  • L1 and L2 Cache in Hibernate (02:15)
  • Hibernate and J2EE (02:29)
  • Additional Benefits (02:48)
  • Summary (00:28)

Getting Started

Hibernate Getting Started (01:24:01)
  • Introduction (00:44)
  • Hibernate: A First Look (02:22)
  • Getting Hibernate to Work (01:56)
  • Classes & Dependent Libraries (02:39)
  • Configurable Logging Categories (01:39)
  • Configuration Using XML (01:21)
  • Hibernate Configuration (04:03)
  • Hibernate Configuration Files (10:55)
  • Mapping a Class to a Table (01:32)
  • The Mapping File (03:55)
  • Optional Attributes (02:56)
  • The Employee Mapping (12:47)
  • The Session (05:05)
  • Ways of Obtaining the Session (03:50)
  • Obtaining the Session Via Spring (02:45)
  • Session and EJB 3.0 (01:01)
  • Attached and Detached (00:00)
  • Methods: Control Object Life-Cycle (14:01)
  • Methods for Reading (01:35)
  • Criteria for Searching (05:09)
  • Transactional Methods (01:04)
  • Other Methods (02:04)
  • Summary (00:26)

Basic ORM

Basic ORM (01:51:39)
  • Introduction (00:44)
  • Hibernate Types (06:00)
  • Hibernate Value Types (01:31)
  • Creating POJO Entity Types (11:38)
  • The <class> Element (03:22)
  • Identifier Column (01:41)
  • Built-in Generator Types (00:59)
  • Identifier Column (01:50)
  • Entity with Composite id Field (00:38)
  • Composite Key as Component (01:27)
  • Mapping Info (00:32)
  • <property> Element Overview (01:48)
  • <property> Element Mapping (02:37)
  • Joins (04:05)
  • Demo: Setting up Database (02:31)
  • Demo: Joined Mapping (13:26)
  • Demo: Two String Method (04:11)
  • Demo: SessionUtil (05:03)
  • Demo: Member DAO Implementation (11:41)
  • Demo: Mapping Entity (11:58)
  • Demo: Hibernate Config. File (09:42)
  • Demo: Running the Test (13:46)
  • Summary (00:17)

Components and Collections

Value Types & Components (01:01:35)
  • Introduction (00:43)
  • Mapping Aggregates (07:14)
  • Using the component (02:36)
  • Using a join (01:07)
  • Using the join (00:18)
  • Collection Mapping (04:23)
  • Hibernate Replacement (00:35)
  • Use Appropriate Interface (00:20)
  • Common Syntax Collection Types (01:49)
  • Working with New Example Order (01:45)
  • Example Using a Set (03:36)
  • Hibernate Bags (03:46)
  • Example Using idbag (00:34)
  • Hibernate Lists (03:06)
  • Hibernate Sets (03:00)
  • Example of a Sorted Set (00:22)
  • Hibernate Maps (02:04)
  • Example of Map Using Key (02:56)
  • Demo: Construction Code (10:38)
  • Demo: Testing (10:03)
  • Summary (00:30)
Collections (42:35)
  • Introduction (00:29)
  • Demo: Collections (05:12)
  • Demo: Mapping (06:24)
  • Demo: Convenience Method (04:43)
  • Demo: Modify Mapping (10:39)
  • Demo: Review (05:56)
  • Demo: Rerun Client (04:47)
  • Demo: HQL (04:00)
  • Summary (00:21)

Entity Association

Entity Association (07:05:34)
  • Introduction (00:54)
  • Entity Associations (00:00)
  • Multiplicity of Associations (02:14)
  • Mapping One-to-One Assoc. (02:20)
  • Using Primary Key Assoc. (02:07)
  • Bidirectional Mapping (07:36)
  • Unidirectional Mapping (01:30)
  • Using Foreign Key Assoc. (01:07:36)
  • Using Foreign Key Assoc. (01:04:20)
  • Using a Join Table (01:00:15)
  • Mapping One-to-Many Assoc. (56:27)
  • Using Foreign Key 2 (50:37)
  • Using a Join Table 2 (04:28)
  • Many-to-Many Inside Collection (01:01)
  • Join with Nested Many-to-One (34:48)
  • Mapping Many-to-Many Assoc. (30:40)
  • Cascading Life-cycle Operation (04:44)
  • Setting the cascade Options (19:54)
  • Do Not Use This (01:46)
  • Fetching Strategies (05:25)
  • Join Fetching (01:13)
  • Batch Fetching (03:30)
  • Subselect Fetching (01:32)
  • Summary (00:24)

Working with Entities

Entity Association (01:24:10)
  • Introduction (00:26)
  • Demo: Mapping Associations (09:27)
  • Demo: Coding Entities (11:41)
  • Demo: Mapping File (11:17)
  • Demo: Loan Mapping (14:45)
  • Demo: Specifying Passive Side (09:49)
  • Demo: DVD Class (09:20)
  • Demo: Borrowing Controller (09:12)
  • Demo: Test Client (07:35)
  • Summary (00:33)