Skip to main content

An Introduction to Hibernate 5

  • Chapter
  • First Online:
Beginning Hibernate

Abstract

Most significant development projects involve a relational database. The mainstay of most commercial applications is the large-scale storage of ordered information, such as catalogs, customer lists, contract details, published text, and architectural designs.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    A relational database is a collection of sets of data items, each of which is formally described and organized. Rules can be put into place for the data such that it can be validated, and indexes can be created such that the data can be queried and updated quickly and safely.

  2. 2.

    Well, perhaps an ideal world in which an ORM is used for data access. But in this book this can be assumed to be the case.

  3. 3.

    See http://docs.jboss.org/hibernate/orm/5.2/quickstart/html_single/#hibernate-gsg-tutorialbasic-entity for more details. Short form: Hibernate uses reflection to construct an object before data population. The shortest (and quickest) path to doing that is with a no-argument constructor.

  4. 4.

    For more on automatic resource management, introduced in Java 7, see the Java tutorial’s reference on it: http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html .

  5. 5.

    Incidentally, if you’re interested, “immeasurably” works out to thirty-two lines. The old way, without ARM, had thirty-two lines of code dedicated to safe cleanup. I don’t know about you, but I like this code better. Not only is it shorter, but it’s harder to mess up.

  6. 6.

    A common criticism of Java is that a “Hello, World” application can take seconds to run, because the VM startup is part of the running time. However, VM startup itself is a rare occurrence for most apps – it happens only once per run, after all – and in an app that runs for hours, days, or months, the time the VM takes to start is not relevant. The criticism is misplaced, unless your business’s purpose is running “Hello, World” in the shortest time possible.

  7. 7.

    Go figure; who knew coders like for things to be code? (Besides coders, I mean.)

Author information

Authors and Affiliations

Authors

Electronic Supplementary Material

Below is the link to the electronic supplementary material.

978-1-4842-2318-5_source code (zip 99 kb)

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Joseph B. Ottinger, Jeff Linwood and Dave Minter

About this chapter

Cite this chapter

Ottinger, J.B., Linwood, J., Minter, D. (2016). An Introduction to Hibernate 5. In: Beginning Hibernate. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2319-2_1

Download citation

Publish with us

Policies and ethics