Errata: Hibernate in Action
FIRST PRINT
- Page 45: last paragraph: Replace "set up the configuration pool" with "set up the connection pool".
- Page 49: last paragraph: Replace "is set with the property hibernate.connection.factory_class" with "is set
with the property hibernate.transaction.factory_class"
- Page 55: middle block code example: Remove the last two lines "### log Prepared..." and
"log4j.logger.net.sf" from the code listing.
- Page 80: fifth paragraph: Change "set the immutable="false" in the class" to "set mutable="false" in the
class"
- Page 108: second paragraph: Replace "The not-null attribute doesn't affect the runtime behavior of
Hibernate;" with " The not-null attribute doesn't affect the runtime behavior of Hibernate in this case;"
- Page 228: second block code example: Replace the line "<many-to-many class="Item" column="CATEGORY_ID"/>"
with "<many-to-many class="Category" column="CATEGORY_ID"/>"
- Page 229: first block code example, dito 228
- Page 332: third code block middle of page: Replace "unsaved-value="0"/>" with "unsaved-value="negative"/>"
- Page 332: fourth code block bottom of page: Replace "since version is 0" with "since version is -1"
- Page 332: add paragraph bottom of page: "However, we will have to change the declaration of the version
property in the [[code font]]User[[/]] class to assign a negative value ( [[code font]]private int version =
-1[[/]] ).
- Page 345: second block code example: Replace the first line from "Interceptor interceptor = new
AuditLogInterceptor();" with "AuditLogInterceptor interceptor = new AuditLogInterceptor();"
- Page 361: first block code example: Replace "<meta attribute="finder">findByUsername</meta>" with "<meta
attribute="finder-method">findByUsername</meta>"
SECOND PRINT
- Page 37: replace "Java Transaction API (JTA, and Java Naming and Directory Interface (JNDI)" with "Java
Transaction API (JTA), and Java Naming and Directory Interface (JNDI)"
- Page 39: replace " we'll always use the Query interface" with "we'll mostly use the Query interface"
- Page 95: code listing, replace "notnull" with "not-null"
- Page 100: page bottom point (1) in listing 3.8., replace BusinessDetails and BUSINESS_DETAILS with
BillingDetails and BILLING_DETAILS.
- Page 106: ending of the 1st paragraph: Replace "the container automatically calls item.getBids().add(item)"
with the container automatically calls item.getBids().add(bid)"
- Page 150: second paragraph, replace "Setting this option to 3 joins all four tables in one SQL statement and
also loads all Bids." with "Setting this option to 3 will not, as you might have expected, also include the
bids of each item in the same SQL query. The limitation to one outer joined collection applies here,
preventing slow Cartesian products."
- Page 150: end of third paragraph, replace "mapped with an eager fetching strategy." with "mapped with an
eager fetching strategy or using the auto default."
- Page 167: code block and third paragraph, remove "before saving the new Bid by cascade (assuming that the
association from Item to Bid has cascading enabled)." This would need saveOrUpdate() instead of lock().
- Page 204: listing 6.1, replace "return new MonetaryAmount(valueInUSD, Currency.getInstance)"USD"));" with
"return new MonetaryAmount(valueInUSD, Currency.getInstance("USD"));"
- Page 204: listing 6.1, switch the lines "if (resultSet.wasNull())..." and "BigDecimal valueInUSD"
- Page 206: listing 6.2, switch the lines "if (resultSet.wasNull())..." and "BigDecimal valueInUSD"
- Page 207: replace "return MonetaryAmount.getValue()();" with "return MonetaryAmount.getValue();"
- Page 207: replace "MonetaryAmount MonetaryAmount" with "MonetaryAmount monetaryAmount" and "return
MonetaryAmount" with "return monetaryAmount" (in two places)
- Page 221: last paragraph, replace "one user per address" with "one address per user"
- Page 227: code-snippet in the middle of the page: "item.getCategories().add(category)" should be changed to
"item.getCategories().add(cat)"
- Page 244: last paragraph: replace "setMaxResult(1)" with "setMaxResults(1)"
- Page 254: first code block, replace double quotes ("foo@hibernate.org") with single quotes
('foo@hibernate.org')
- Page 268: last code example, replace "User user" with "User givenUser"
- Page 284: last code snippet at the bottom, replace "where" with "on".
- Page 333-336: every code example: replace every "unsaved-value="0"/>" with "unsaved-value="negative"/>"
- Page 333-336: every code example: replace "since version is 0" with "since version is -1"
- Page 334: first code example, replace "session.load(User.class, user)" with "session.load(user, user)"
- Page 334: second code example, replace "o = null" with "o == null"