< Zurück | Inhalt | Weiter >

pBeans7

pBeans does fully automated persistence of JavaBeans. You have to follow the rules for writing beans (not EJBs, but the “classic” JavaBeans), but once done, this will automatically persist your instances to any JDBC- compatible database. No XML specification, no SQL scripting, no tem- plates. For the easiest “just save my instance data” type of applications, this can be a good choice.8 This product even automates the creation of tables, as we advocated above.

Are there others? Heck, yes. Not all of them persist to relational databases. Some persist only to XML. Some to other databases like B-trees or the Berkeley DB system. We didn’t concern ourselves with those. We also left off a couple of libraries that appear not to have been developed for more than a couple of years.


image

4. http://www.hibernate.org/

5. http://db.apache.org/ojb/

6. http://castor.exolab.org/

7. http://pbeans.sourceforge.net/

8. But we are not endorsing here.


14.8 PERSISTENCE IS NOT THE WHOLE STORY


In this chapter and throughout this book we take a practical view that a database is there to store an application’s data. That’s far from the intent. A relational database is designed to create collections of data and to perform logi- cal queries within and between those collections. The relational model is much more than application storage. It facilitates all kinds of data analysis. This is often ignored in enterprises these days.

Don’t forget that designing database tables should take into account concerns beyond mere application storage.


14.9 SETTING UP POSTGRESQL FOR BUDGETPRO


Let’s turn our attention to installing and starting PostgreSQL to support the BudgetPro application.