News: The Easiest Way To Learn Hibernate: YouTube Videos and the Online Tutorial

  1. I'm a big fan of Hibernate, and I've worked pretty hard to try and make the technology as accessible and as easy to understand as I possibly can. My book on the subject, Hibernate Made Easy, has got some pretty decent reviews on Amazon, and the corresponding website, www.hibernatemadeeasy.com, gets some pretty decent traffic. So, it seems like the message about doing Data Persistence with Hibernate is getting out there.

    One of the biggest problems I find people have with Hibernate is just getting started. Hibernate and JPA are pretty mind-friendly topics, but if you can't get a simple connection to your database working, well, it can get pretty frustrating. To try and help alleviate that problem, I've put together a few video tutorials that show you how to get started with Hibernate, and how you can install all of the things you need in order to run something more substantial than a "Hello World" application.

    The video tutorial goes hand in hand with this webpage tutorial, so it's easy to follow along:

    Getting Started with Hibernate and JPA Annotations

    Now, I've got to stress: this is a very basic, from the grounds up, tutorial. It starts out with a basic Windows XP installation, and not much else.

    The first video tutorial takes you through these mind numbing steps:

    Downloading the JDK
    Installing the JDK
    Downloading MySQL
    Installing MySQL
    Downloading MySQL Tools
    Downloading MySQL JDBC Drivers
    Installing/Unzipping Drivers and MySQL Tools

    Yeah, I know, who needs to watch a video that does all that? It's good for beginners, and the nice thing about the video is that no step is missed. So, if someone is having a problem, they can check to ensure they've followed all of the right steps.

    The second video tutorial gets more to the heart of the matter. It follows the content on this webpage tutorial, and shows you how to annotate a JavaBean/POJO, and then use Hibernate to connect to the database and create the underlying tables. Again, it's a simple example, but the key is the fact that if you can get this to work, then your database and Hibernate environment is working, and once that happens, learning everything else simply becomes fun and easy, as you focus on learning the technology, and not fighting with the environment.

    If you know someone who's struggling to learn Hibernate and JPA, send them along to both the site and the tutorials. Many a Java professional has found them handy.

    Video Tutorials on Learning Hibernate
    Hibernate Made Easy WebSite
    Recommended Books for Learning Hibernate
    My Similarly Coloured Book on The Simpsons

    Threaded Messages (23)

  2. Thank you[ Go to top ]

    This hits it right on the head.  I have played around with Hibernate on a few occassions and the biggest issue I have with it is the environmental setup.  I wish I would have known about you rbooks, videos, etc. earlier.  I may have actually been pretty good with Hibernate by this point :-).

  3. >>I may have actually been pretty good with Hibernate by this point :-).

    I wish more people knew about the books too! I may have actually been pretty rich by this point. :)

    The tutorials deal with Hibernate Core 3.2.5, and Hibernate Annotations 3.3. The latest release of Hibernate, 3.5, uses JPA 2.0, while these tutorials use an earlier version of JPA. If the video tutorials catch on, and people can deal with my Canadian accent and my 'lip smacking' which everyone complains about, I may throw in a few updates for the JPA 2.0 compliant Hibernate edition as well.

  4. calm down[ Go to top ]

    its ok man.. u learnt it now? be happy.

    there r many who r still struggling... help them out

  5. Hibernate is a complete waste of time and resources.

  6. Ironically[ Go to top ]

    Ironically, both of your positions are incorrect. ORM tools save a great deal of time, which is why they are so popular. Secondly, Hibernate, after all is said and done, simply issues JDBC statements, and their caching mechanisms are incredibly intelligent, so they can actually reduce resource consumption, although counting clock ticks should never be a primary reason for using an ORM.

    Of course, if you're saying that you don't like Hibernate, well, you're entitled to your opinion. Despite any shortcomings, I'd choose an ORM tool over hand-coding JDBC and SQL statements any day of the week. :P 

  7. Ironically[ Go to top ]

    Yeah, you're right. "select * from...", "update...". This "hand-coding" of SQL is tough business.

    BTW, there is no reason for your tongue waggling.  

  8. hand-coding[ Go to top ]

    there is more... u need to convert those into object models, populate domain models.. same thing with update, need to refer values from domain model when u construct queries etc. it gets a little messier with a lot of boiler plate code.

    that said, i dont share the enthusiasm of the author. hibernate has its uses, but not a complete replacement.

  9. hand-coding[ Go to top ]

    there is more... u need to convert those into object models, populate domain models.. same thing with update, need to refer values from domain model when u construct queries etc. it gets a little messier with a lot of boiler plate code.

    Wow. Really? *roll eyes*


  10. Ironically[ Go to top ]

    u r wrong too.. just because u wrote a book on hibernate does not mean u shud defend hibernate. u shud let hibernate or any technology for that matter defend for itself.

    btw, yr book was a damn good.. it did help me to learn the stuff well and fast. thanks!!

  11. Thanks For The Kind Words[ Go to top ]

    Thanks for the kind words about the book. :)

    My defense is really for ORM tools, not just Hibernate. And I try to stay enthusiastic about technology, especially when I'm teaching it - people want to feel good about the things they are learning. At the same time, I'm not under any illusion that Hibernate is the holy grail. I like it, and it's worked well for me, but I appreciate that like everything else, it has its shortfalls.

  12. Hibernate can be a very good solution, but don't use it for everything that runs against a database. We recently converted a large and complex application from Hibernate to PL/SQL and now it runs 100 times faster. The original application which runs fine on everything up to Hibernate 3.2.X breaks all the way on Hibernate 3.5 because they messed up the seqhilo identifier generator. So we might drop Hibernate all the way in future, which is a shame because the product really stands out in other areas.

  13. 100 times faster[ Go to top ]

    "We recently converted a large and complex application from Hibernate to PL/SQL and now it runs 100 times faster."

    Ssshhhhh, don't tell the Hibernate zealots that.




  14. if you have a very complicated object domain model which needs complex stored procs, i think hibernate it good.

    but for simple stuff - plain jdbc or jdbc with spring is the best way to go.

    i have seen people mess up hibernate because they have to realize hibernate has to be tuned well as well. it fires queries which can be aweful at times.

    i have also gone back from hibernate to plain jdbc on some projects . and peopel who say they cant think of anything but hibernate for everything DB are plain stupicd and lazy.



  15. performance figures[ Go to top ]

    did anyone notice how perfrmance figures are always reported as 100 times faster, 50 times faster, 200 times faster..

    no one says 37 times, 41 times or 62 times... makes me wonder if they just cook up figures..

    hibernate has a small performance penalty, but i believe ur case is exception maybe u did a bad job with mapping, or the guy who wrote the pl/sql was just smart or may be u left out some if conditions in pl/sql..

    there r many reasons... u need to discuss the problem well.. why shud we just accept yr performance figures?

    if what u say is true, and if u hv any guts/balls post the hibernate mapping and the pl/sql code, and let this forum be the judge


  16. Hibernate Cache[ Go to top ]

    The Hibernate Cache, and 2nd level cache, can really reduce database hits, and improve performance. If you compare a JDBC app that doesn't use a cache, and Hibernate, Hibernate will usually perform better, simply because of the cache.

    If someone is getting a significantly better performance number, they must be spending time doing some home-grown caching of data, and if they are, it would probably be tailored for their application in a way that an off the shelf ORM model never could. Either that, or they never properly configured Hibernate to use its cache properly. In either scenario, I'm not sure if it's a fair comparison.

    I find many people don't properly understand how Hibernate works, which was a big motivation for writing my book. When people understand what Hibernate is doing, they start using it properly, and then start really benefiting from things like the Hibernate cache.

  17. complete the sentence[ Go to top ]

    u left it half way.. i hv completed it for u:

    Hibernate is a complete waste of time and resources for dumb people like me who can't figure anything intelligent, though we do a good job being trolls!

  18. complete the sentence[ Go to top ]

    If I ever meet you in the real world...

  19. Hibernate is a complete waste of time and resources.

    Agree! It is like changing your problem from the left foot to the right ! In the process, one may get other troubles too as a bonus!

    Shortcomings of a database system (here relational model) cannot be solved by such gimmicks! Why didn't the  OO guys make a new OO-database and solve the problem?



  20. Second video tutorial[ Go to top ]

    Is it just me who can't find the second video tutorial? When I click the link "second video tutorial" I get the first tutorial again. The first one was pretty good but I'm more interested in the coding part that is done i part 2.

  21. Both videos are uploaded under the same account. The two should both be listed on the right hand side, although you may see a different youtube template depending on how you've set up your environment.

    This should link directly to the second video, Editing hibernate.cfg.xml and JPA Annotations for POJOs




  22. Long time ago, I did use Hibernate Implementation directly but these days and age, would it better to jump straight into JPA 2.0 API and not use Hibernate API? I sorely missed the Hibernate Search method that JPA 1.0 lacked but I heard it's part of JPA 2.0 now.  So, I'm not too sure if learning Hibernate API is necessary any more.

  23. jpa 2.0[ Go to top ]

    jpa 2.0 is part of jee 6, and commercial servers are not yet there.. shud be there in 2011 timeframe.. can expect ibm to be ready by 2012 or so... usualy they take more time due their process etc

    until then hibernate is yr only hope...

  24. hibernate is not dead[ Go to top ]

    So, I'm not too sure if learning Hibernate API is necessary any more

    u r wrong. hibernate is not going anywhere. jpa is a choice, hibernate is a choice.. when their is a choice there is always a choice to choose yr choice!