Take your programming skills to the next level with our Java e-learning programme

Hibernate and JPA

featuring HQL, JPQL, Optimistic and Pessimistic Locking, Lazy Initialisation, Detached Objects and Performance
  • This Hibernate and JPA training course takes you through all of the major features of Hibernate.
  • The course is fully practical, and is essentially a 23 hour pair programming session. You will develop production standard code, from scratch in your own IDE.
  • The Hibernate Training starts from the absolute basics, and takes you to a professional standard.
  • The JPA Training explains how Hibernate became a Java Standard, and with small changes to your code, you can change which implementation of JPA you work with.

Pre-requisites

You will need some Java programming knowledge - you will need to be able to create classes and objects, and understand the basic syntax.

No database knowledge is required as an overview of SQL is given.

Contents - contains over 23 hours of video - equivalent to 5 days of live training.

 

Having problems? check the errata for this course.

1

Introduction


23 m 55 s
A general overview of Hibernate - why would you use it?

2

Getting Started


60 m 52 s
We set up your development environment and install Hibernate. Also, an overview of SQL if you need it.

3

Persisting Objects


31 m 24 s
How to change a plain Java class into a persitable class.

4

Configuring Hibernate


40 m 33 s
How to configure Hibernate, including the hibernate.cfg.xml file

5

Manipulating Objects


36 m 39 s
How to update and delete objects.

6

More on Mapping


47 m 54 s
More options when you are mapping your classes - @Table, @Column annotations and the difference between field and property access.

7

Crashes and Logging


22 m 17 s
How to handle exceptions properly in Hibernate. We also configure log4j to give detailed information that will be useful later.

8

Relationships


41 m 31 s
We create a Many-to-One relationship and study how this affects the database.

9

Collections


56 m 8 s
We now switch to collections - Sets, Lists and Maps and see how to handle a One-To-Many relationship.

10

Bi Directional Relationships


32 m 23 s
One of the biggest mismatches - relations on a database are bidirectional. If you want the same in the Java, you have to work hard!

11

Many to Many Relationships


28 m 23 s
This short chapter is followed by a major coding exercise.

12

equals and hashCode


40 m 1 s
This is standard Java, but extremely important with databases. We'll also see that autoincrement IDs are not a good choice for implementing equality.

13

XML Mappings


46 m 35 s
Optional chapter - only needed if you are using the legacy XML coding style.

14

Java Persistence API


47 m 4 s
The JPA is a standardised version of Hibernate - see the differences. We will use JPA for the rest of the course.

15

Cascades


28 m 0 s
Cascades can reduce the amount of persistence code you write.

16

Embedding Objects


53 m 17 s
How to use the @Embed and @Embeddable annotations.

17

Queries - Part One


43 m 38 s
How to use the HQL and JPQL.

18

Queries - Part Two


45 m 22 s
More on HQL and JPQL.

19

Queries - Part Three


48 m 21 s
Even more on HQL and JPQL!

20

Criteria API - Part One


38 m 36 s
How to use the Criteria API in the Classic Hibernate (ie using Sessions).

21

Criteria API - Part Two


50 m 58 s
JPA2 also has a criteria API. Full details, including the TypeSafe API.

22

Inheritance


64 m 14 s
Three different strategies for handling inheritance - "Single Table", "Joined Table" and "Class per Table".

23

Detaching and Merging


52 m 40 s
What is detaching - and how to use the merge() method. Also covers the classic versions of update() and saveOrUpdate()

24

Optimistic Locking and Versioning


41 m 0 s
What is optimistic locking? We see that Hibernate can version objects to prevent concurrent database changes affecting your business process.

25

Pessimistic Locking


37 m 58 s
These are real database locks and we explain when they need to be used. Also, the difference between PESSIMISTIC_READ and PESSIMISTIC_WRITE.

26

Lazy Initialisation


52 m 14 s
This is Hibernate's biggest performance optimisation. We see how you can avoid the LazyInitializationException.

27

Tuning Performance


43 m 8 s
More options for performance tuning, include Batch Fetching.

28

First Level Cache


39 m 6 s
Everyone needs to understand the First Level Cache. Full details in this chapter.

29

Second Level Caching


80 m 59 s
An optional chapter: we configure EhCache as a second level to tune performance.

30

Web Applications


78 m 27 s
We now look at a full application that uses JPA and Hibernate.

31

Spring Applications


44 m 43 s
How does Spring help with Hibernate? (Nb you need to have studied the previous chapter before this one).

32

EJB Applications


51 m 51 s
If you're using JavaEE with an application server, then this chapter shows how to integrate JPA with that. We use Glassfish as an example.

33

Course Review


22 m 6 s
The best books on the market, where to go from here and a few things we missed!

34

Bonus Chapter - Isolations


17 m 58 s
This is a short extract from our Spring Fundamentals course, where we cover Isolation levels. This may be of interest if you want to explore locking in a little more detail.

Let the Course Come to You

About Us Pricing Frequently Asked Questions Contact Privacy T&Cs Affiliates and Resellers
Facebook Twitter YouTube