Thursday Aug 07, 2008

Hibernate - POJO and HBM file creation best practice

Recently I was working on Hibernate and created a number of POJO and their corresponding hbm file. I am  using Netbeans (who has support for Hibernate plugin , real helpful , )

Certain best practice I would like to make work more interesting.

  • Keep table name and POJO name same.

ex. Create new Java Class  i.e Person , Use hibernate plugin to create .hbm file , Give same name as Class file , Select Person as class name on next screen.

  This will create .hbm file with name as Person , no need to provide table attribute. Hibernate will create table with same name.

This aovides unnecessary complexities in distinguice table name and class name

  • Keep POJO variable name same as Field name

      Do no mention Column attribute while declaring <Property> in .hbm file. Hibernate will create column with same name.

  • Try to keep ID as primaray key for all the Tables where possible. Less to remember and more time to figure out solution to problem on hand. 
  • How can I forgot my Dear I18n. There is nothing much as long as you make sure that created Database has UTF-8 encoding.
  • One more point , Certain tables are used to keep default list. If the list compoment is localizable make sure you take care of fetching localized values from proper resource bundle before publishing to User Interface.

Resources :

More will follow as I learn more ... enjoy your life ... n keep doing innovation ... only way to survive ...

Friday Jun 13, 2008

Netbeans 6.1 Multilingual released , Portal Pack ML will follow soon

Checkout ML release for Netbeans 6.1  It is localized in three languages Japanese (Ja) , Simplified Chinese (zh_CN) and Portuguese (pt_BR). I have download and installed , it looks great. And major difference is perfromance from last release , it quite fast. have fun with Netbeans ..

We are working on ML release of  Portal Pack 2.0( It will be released soon. Watch this space for more details on Portal Pack 2.0 ML. 

Friday Aug 03, 2007

OpenPortal at University Day in Bangalore!!

    I have been involved with Sun's University relations initiative for a few months now. The present project involves evangelizing Sun's technologies in colleges so as to capture the mindshare of students.

    Acharya Institutes is situated on the outskirts of Bangalore and we needed to get there by 8AM, so I had to pull myself out of the bed very early (I rarely see early mornings , it was beautiful :))

    As we reached the institute, all of us were amazed by this huge campus of 100 acres with around 20 buildings under construction and mind blowing architecture (award winning apparently) . Mr Vishwanathan, who is the HoD and other college authorities welcomed us and took us to the auditorium.

    Audience was final year students from various colleges of Bangalore and adding to our surprise, there were International students (from Africa) with basic knowledge of Java. My goal was to get them interested in OpenPortal and Portlets. I started with some visuals of OpenPortal samples and iGoogle to give them an idea of Portal Server. I introduced the concepts of Portlet development and explained why this is interesting since they are eager to figure out why this is important to them. I then presented the main topic of the day “OpenPortal Portlet Container” and “NetBeans Portal Pack plugins” by showing several screenshots and a demo.

     Demo got everyone's absolute attention as they were amazed to see with just few clicks on NetBeans (pre-installed with Portal Pack and configured with OpenPortal Portlet Container), a Portlet got developed, deployed and most importantly running in our OpenPortal Portlet Container. It was pretty cool to show this demo to these students (customers!) I was thrilled to see the curiosity and excitement in their eyes! Kudos to NetBeans Portal Pack and OpenPortal Portlet Container team for such a wonderful gift to industry.

    This demo resulted in healthy Q&A session as students showed a lot of interest and asked great questions about Portlet Development and NetBeans. One of common question worth to mention was “Can they really contribute with limited knowledge they have”, my answer was “Yes” with reasoning, and they can learn a lot from experts in an Open Source project and develop themselves. There is lot of scope for contributions in any Open Source project, not just 'Write Code' as they seem to think.

    As a final remark I have informed them Portlets are here to stay and conquer the web development world so be a part of it … Pointed them to Open Portal, OpenPortal Portlet Repository.

    Next in turn was “Application development using NetBeans” by Amol Desai then much deserved lunch. At the end we have received Memento and “In Office Golf Kit” which was best part according to my team mates when I reached office after long journey in peek hour traffic of Bangalore. An End of Wonderful Experience but Beginning of OpenPortal at University programs in Bangalore.

(from left) Prof . Vishwanathan , Amol , Myself , Srinith , Students @ Acharya




Mahipalsinh Rana


« July 2016