DekGenius.com
Previous Section  < Day Day Up >  Next Section

7.5 Summary

In this section, I introduced Hibernate. It's a transparent persistence framework for Java beans to relational databases over JDBC. The five basic steps for Hibernate applications are:

  1. Create the model.

  2. Create the database schema.

  3. Map the model to the schema.

  4. Configure a session factory.

  5. Use the model.

The message board application that we built showed each of these five steps in action. You saw how to create a model with nothing but business logic, composed of pure Java beans. Then you saw how to save and load data from that model using simple Hibernate commands.

Hibernate upholds the five basic principles set out in Chapter 2 through Chapter 6. I showed that Hibernate provides a simple, transparent approach to persistence that some other persistence frameworks lack. I also demonstrated that the benefits of simplicity extend beyond the framework to applications that use Hibernate. Then I pointed out where Hibernate users can embrace and extend the framework in all of the right places, such as providing SQL dialects, JTA transactions, and allowing full access to the JDBC connection. I finally showed how Hibernate can improve and suggested some persistence alternatives. In the next chapter, I introduce Spring, a small, light container.

    Previous Section  < Day Day Up >  Next Section