Wednesday, 26 September 2007

Twenty20 Cricket: India are World Champions

5 runs was the difference and India were on the right side of the victory margin for once. They have finally shed the losers tag to pick up the first Twenty20 world championships. On the way to the final they beat South Africa, Australia and Pakistan. All exciting and close matches. It was ultimately a question of who could hold their nerve and hit furtherest and we all know that now.
A fitting victory to the Indian cricket team which was without their big stars, did not have a coach, a new captain and nothing to lose.

Sunday, 23 September 2007

India edge out Australia

There are cricket matches and then there are those cricket matches. The India-Australia Twenty20 2007 World Cup semi-final was one of those cricket matches. It began at 2am Australia time and we got to see some scintillating cricket from both teams.

The Indian team, written off before the start of the tournament was a revelation. Sensible batting, clean hitting and some top class bowling in the dying moments of the match meant that India had finally outplayed the world champions,Australia and registered a convincing victory. The Indian Cricket Board was quick to rush in and announce an award of US$1 million for vanquishing Australia and entering the Finals and there was a Porsche911 for the man of the match, Yuvraj Singh.

Having won 6 out of 7 matches in the tournament, there is only question left?Can India lift the cup by beating Pakistan or have they just had their final moment of glory? Tomorrow, we will know the answer.

Friday, 14 September 2007

MiddleGen and Hibernate: Making life easy in the middle

If you have been working in the Hibernate or in the EJB space, chances are high that you have had to write intermediate files such as hbms, in the case of Hibernate, that bridge the gap between the database tables and the Java objects (read POJOs) that exist within the application and are responsible for transporting data around.

While writing the hbm files manually, is a good idea if you really want to learn about how they are structured and the different types of relationships that they can be define within the data model, it becomes a tedious task if your data architect is not sure of what he or she is doing and/or keeps changing the DDL regularly.

In an AGILE project scenario, where requirements are welcomed at late stages of the build process, having a tool that can generate the hbm files and the related Java files (which are essentially POJOs) can be a boon. This is where MiddleGen comes in.

While MiddleGen is basically (an open source) database driven tool for generating code from the database to the presentation layer (Struts), I found its confluence with Hibernate to be really useful. It took me basically half-an-hour to set up MiddleGen and configure the Ant Tasks that came with the sample set of examples (in the MiddleGen download), to connect to my MYSQL database and generate a set of hbm files and their corresponding Java counterparts. In my next post, I'll explain the sequence of steps that I followed in setting up MiddleGen to talk to my database and generating the hbms and the Java files.