Hibernate truly deals with all of the database concerns you??™d typically have to take on
yourself. In fact, Hibernate can create the database for you on the fly! This is in fact precisely
what will happen with Timekeeper. You won??™t find any of the table creation code you saw in
previous projects; Hibernate will take care of all of that for us.
CHAPTER 9 n TIMEKEEPER: DWR EVEN MAKES PROJECT MANAGEMENT FUN! 459
Hibernate also deals with automatic primary key creation for the objects you persist to
the database. Hibernate allows you to have associations of various kinds between objects, so
you lose none of the power you??™ve likely grown accustomed to in the realm of straight JDBC
programming.
I??™m going to skip showing you any code examples here as I??™ve usually done in previous
projects. I believe Hibernate is a lot easier to understand when viewed in context, so that??™s precisely
what we??™ll do as we dissect the application together.
TO ORM OR NOT TO ORM, THAT IS THE QUESTION!
There are some pretty strong feelings on both sides of the question of whether ORM tools are something that
should be embraced or not. There are good arguments on both sides, but thankfully it??™s your choice to make!
My own personal opinion, for what it??™s worth, is how I typically approach any technology decision: analyze
the particulars of a given situation and choose the best tool for the job (a lesson my father taught me all
those years ago when I tried to put a nail in a piece of wood with a large pair of pliers just because it??™s what I
had handy!).
Pages:
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785