All I wanted to do was get started learning "the basics" of persisting data to a database. Maybe basics is the wrong word. Because I know how to get it done in PHP. I know how to get it done in Perl. I even know how to make it work in Java using JDBC and SQL. What I don't know is how to automate it all so I can write less code. That is where Hibernate comes in.
My goals were simple:
Create Hibernate Object that connects to the database.
Create Test for Hibernate Object
So I started with a read of Hibernate Kickstart
Wowsa. First, IDEA can't find Datastore. Trying to solve that problem I found Raible's blog which helps me with the needed libs.
Then it is time to fire up JUnit. I spent the next 2 hours tracking down needed
jars. Google is my friend. Add dom4j and cglib to my growing lib directory. cglib took two tries because I downloaded the one WITHOUT bcel (whose homepage does not have a download link I might add).
Now the SessionFactoryImpl is complaining about not being able to find org/apache/commons/collections/ReferenceMap. It appears that it is time to upgrade my commons libs. Gonna get struts 1.1rc1 while I am at it. Struts may not have changed much, but the libs surrounding it have. I can't believe I have been working with Struts since September.
I am going to browse Raible's Struts-Resume application and see if I can steal ideas on how to do tests since mine are blowing up. The tests are complaining about not having an InitialContext... hrm.
You know... Sometimes I think Microsoft may have it right. You drag a component onto a screen and VisualStudio takes care of a large amount of the coding for you. It is all done behind the scenes and you don't have to worry about knowing how it gets done. Then I think about the time I wanted to send a friend a JavaScript through Outlook. I wanted to get to the JavaScript after I had sent the email. So I trek to sent folder and open the email. Outlook tells me, you can't look at it, because it may be dangerous. Makes sense, but since I have a clue and knew what I was doing, I looked for a way to FORCE Outlook to give me that file. No such luck. I wanted to shoot Outlook. I was taken care of and didn't need to view that JavaScript because it may be dangerous. Lets not talk about why it was dangerous... that is another story all together that I am sure you can read about elsewhere. Back to my plight...
If I want to be efficient in my developing, I now need to know OOP and all that is the philosophy of how to write good code. I need to know syntax of a bazillion libraries: Xdoclet, Hibernate, Struts, JSTL not to mention, XML, XSL, HTML, CSS and JavaScript.
Allowing the man behind the curtain to control things for me is starting to look nice. Or should I just give it up and go back to writing Perl :) I will stop my rant here because others have said it in greater detail before.
I can't give up on Java now. I like it to much. I just wonder if I will ever catch up to the likes of Matt Railble.
Posted by carl at March 2, 2003 05:52 AM
I don't know that there's much catching up to do. I'm sure most folks could learn what I know in about a week. ;-)
I've only learned what I know from banging my head against the wall for many hours on many occasions. It's the only way to learn - frustration followed by victory!
Posted by: Matt Raible at March 5, 2003 01:10 AM
Well, it clearly wasn't the case with you, but when I downloaded Hibernate2, it came with all the libs it needed, including the ones you mention above.
Posted by: Phil Wilson at June 18, 2003 09:19 AM
Phil,
Thanks for the comment. I have to admit, when I wrote this Hibernate2 was still young and not fully put together. As you probably know, they just release 2.0, so I am sure they have all of their ducks in a row now. I have not gone back to give hibernate another try. Mainly because I don't want "yet another query/scripting language" added to my muddled brain. I know SQL, and the parts where I have uncertainties or issues, I have friends that REALLY know SQL. So I prefer to use something along the lines of iBatis or Torque.
At some point in time, I will revisit data layer technology and give Hibernate another shot.
Carl
Posted by: Carl at June 18, 2003 09:19 PM
Comments