Harnessing Hibernate

Errata for Harnessing Hibernate

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Safari HTML
Chapter 5. Richer Associations

The "Figure 5-1. Models of the tables, concepts, and objects involved in representing album tracks" repeats the label ALBUM_TRACKS twice in the "Database Schema" section. ALBUM_TRACKS once above the schema for the table which stores the collection and a second time over the tracks table. The second time I believe it should have been just TRACKS.

Not really an error, but "Example 5-1. Eagerly initializing the track artist associations" changes the key column name from TRACK_ID to TRACK for the TRACK_ARTISTS set. Earlier in the text it appears as TRACK_ID, but this is just a snippet and not a restatement of the Track class xml mapping.

Note from the Author or Editor:
Yes, sadly, the right-hand table should be labeled TRACK rather than ALBUM_TRACKS. That is how it was labeled in the version I checked in, but it got changed in production. Why does this figure get semantically mangled before press every time? I find it very frustrating!

Anonymous  Jun 04, 2008 
Page Section 13.2.5
Third paragraph

When discussing how Hibernate integrates with Spring.

Sentence: "The Stripes API provides a simple way to tolerate such implementation-specific exceptions by wrapping them in its own generalized data access exceptions."

Should be: "The Spring API..."

I'm reading the PDF version online at Safari so I don't have a page number.

Scott Jones  Feb 04, 2009 
On Figure 5.1 of section 5.3 (No page number available online)

Right hand Entity ALBUM_TRACKS should read "TRACK"

Note from the Author or Editor:
Yes it should. That's the way the figure was when I submitted it, but it got messed up somehow on the way to press, sadly.

Anonymous  Jun 04, 2008 
Page 15

The zip file containing the examples on your website at seems to be corrupted. I am running Windows Vista and am unable to unzip the file. It appears that for every directory within the zip there is a peer file of the same name which causes unzip to choke since i don't think you're allowed to have two peer filesystem elements with the same name in a zip archive. I was also unable to unzip using command line jar utility. Please let me know of a workaround. Thanks, Jon

Note from the Author or Editor:
I don't have access to Vista, but I tried looking at this archive under Windows XP in a virtual machine, and do see those strange parallel files this reader mentioned. Despite them, I was able to extract the file contents using XP's zip support. Vista must be pickier?

The do not show up under MacOS or Linux, and do not cause a problem when you use jar to extract the zip file's contents, but we should fix the archive on the download site so that people can use their familiar unzipping tools on Vista.

I don't know who created the archive or who can update it. I was able to rezip the archive on my XP virtual machine, and that repackaged version does not seem to contain the problematic parallel documents. There does not seem to be a way to attach files to this errata mechanism, so please let me know how to get in touch with the people maintaining the download site to see how I can help get this corrected.

Anonymous  Sep 29, 2008 
Page 21
Last paragraph

In the last paragraph on page 21, the URL for the Maven 2 repository is correctly identified as However, in the example URLs (Example 1-3. URLs for project dependencies) located at the bottom of page 21, the URLs for the Maven 2 repository omit the maven2 portion of the URL and are identified incorrectly as<rest of path> and<rest of path>

Note from the Author or Editor:
I was hoping Tim would weigh in on this, as our Maven maven, but as far as I can tell, the reader is completely correct; the two URLs on the bottom of page 21 need "maven2/" inserted immediately following "". So they become:

Anonymous  Sep 10, 2008 
Page 88

I think I know what you mean, but I couldn't quite make sense of:
RE: lazy
"Because this can lead to unexpected crashes far away from the Hibernate-
specific code, you can turn it off in cases where the effort of making
sure anything you might need to use outweighs the potential cost of
loading more than you really need..."

Note from the Author or Editor:
Ah, yes, there is some language missing. It should be something like this:

“Because this can lead to unexpected crashes far away from the Hibernate-specific code, you can turn it off. But then you need to make sure you explicitly load anything you might need before closing your Hibernate transaction. Sometimes the data is simple enough that you can simply load it all, because the cost of getting more than you need is small, but sometimes you need to think hard and code carefully.”

Michael Sweeney  Feb 14, 2011 
Page 96
5th paragraph

(96): language change or minor formatting problem

Reads "This mapping achieves the goals with which we started 'with' illustrates...."
should be 'which illustrates'

Note from the Author or Editor:
This is completely correct; a comma might be nice too:

This mapping achieves the goals with which we started, which illustrates how arbitrary information can be attached to a collection of associations.

Anonymous  Nov 02, 2008 
Page 96

This mapping achieves the goals with which we started with illustrates how arbitrary
information can be attached to a collection of associations.

Note from the Author or Editor:
Yes, this slipped through the copy editing process! I expect I was trying to say something like: “This mapping achieves the goals with which we started, and illustrates how arbitrary information can be attached to a collection of associations.”

Good catch, thanks.

Michael Sweeney  Feb 14, 2011 
Page 100
2nd paragraph

ALBUM_TRACK schema is referenced several times in this paragraph. I think it should be ALBUM_TRACKS with the 'S' at the end as that's consistent with the actual table name.

Note from the Author or Editor:
This is correct. All three mentions of the ALBUM_TRACK schema in this paragraph should be ALBUM_TRACKS instead; although the class name AlbumTrack is singular, the table name is ALBUM_TRACKS, plural.

Anonymous  Nov 02, 2008 
Page 107

Collections doesn't have a remove() method (?)

Note from the Author or Editor:
I believe this is referring to the note about what happens if you use the standard collections delete methods to remove an element from the track list.

The note is referring to the java.util.collections package, rather than the specific class java.util.collections.Collections. As such, I agree it would be more clear to set the word “Collections” in lowercase, and perhaps even either spell out the full package name, java.util.collections, or use normal running text font rather than the identifier font.

Michael Sweeney  Mar 11, 2011 
Page 148
import statement

SourceMedia and StereoVolume class is not in the same package. Thus should include

import com.oreilly.hh.SourceMedia;
import com.oreilly.hh.StereoVolume;

Note from the Author or Editor:
The problem is actually in the listings of the SourceMedia (p. 113) and StereoVolume (p. 127) classes. We moved these into the package towards the end of the writing process, and evidently these listings did not get updated. The downloadable code examples are consistent, but this will definitely confuse readers. The package statements in these classes need to be updated to include the ".data" portion.

Anonymous  Aug 15, 2008