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.



Better, Faster, Lighter Java
Better, Faster, Lighter Java
ISBN: 0596006764
EAN: 2147483647
Year: 2003
Pages: 111

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net