Chapter 12. Best Practices, Style Guide, Tips and Tricks

Hibernate supports several different systems for building applications. For example, you can start with Java objects (as shown in Chapter 3) or with an existing database (as shown in Chapter 4). If, as sometimes happens, you “inherit” a system, this may force your hand by making it necessary to start from an existing database.

In this chapter, we'll look at a few available technologies and solutions for reducing or improving your code. They aren't required but may make your life with Hibernate easier. They include:

  • Reducing code with inversion of control.

  • Reducing session-creation impact with ThreadLocal.

  • Using Hibernate as an EJB BMP Solution.

  • Integrating additional tools and technologies.

Get Hibernate: A J2EE™ Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.