Slashdot Mirror


Hibernate in Action

Adrian Spinei writes "From a documentation point of view, Hibernate is one of the most notable exception in the world of LGPL'ed projects. Its website offers a plethora of information, from solid documentation (the reference has no less than 141 pages) and various FAQs to sample projects and third-party resources. The forum is quite active and you may get answers to tricky questions. Or a little bit of rough treatment in case you haven't RTFM - but that is understandable, given the number of questions that the authors have to answer every day. Under these circumstances, one might wonder what Gavin King (Hibernate founder) and Christian Bauer (documentation/website maintainer and Hibernate core developer) can add in order to be able to write a 400-pages book about Hibernate. I mean - sure - only by joining the reference documentation, different FAQs and guides, one can easily 'extract' a hefty 'manuscript' with more than 200 pages." Read on for Spinei's review of Hibernate in Action. Hibernate in Action author Christian Bauer and Gavin King pages 400 publisher Manning rating unavoidable reviewer Adrian Spinei ISBN 193239415X summary ORM pour les connaisseurs

Well, I am glad to tell you that this is not just a dump of the on-line docs. The book not only gets you up to speed with Hibernate and its features (which the documentation does quite well). It also introduces you to the right way of developing and tuning an industrial-quality Hibernate application. I consider myself a pretty seasoned Hibernate developer, being familiar with the API since its 1.2 version in Q1-2002 (if I remember well the first app when we used Hibernate). However, I was proved wrong by Hibernate in Action, which describes best practices and even API features that were unknown or vaguely known to me. That is, until now.

The first chapter, in the good tradition of all first chapters in the world, is an introduction. It's a very well written introduction about why do we need ORM solutions in OO applications. The chapter explains the O/R impedance mismatch, while declaring quickly that OODB sucks (immature and not widely adopted). Wel'll also find out that EJB also sucks from a persistence point of view (for various reasons). Which can be quite a surprise knowing that Gavin is one of the authors of EJB3.0 specs. Or, on the contrary, this will explain a lot of things in the new EJB specs.

Now that we have cleared the "why Hibernate" issue, let's continue to the second chapter. Which - tradition obliged - is a "Hello, world" and a "Let's get started" chapter. Here you go: almost 50 pages later you should be able to write simple Hibernate-based persistence layers and integrate within an application server, like for instance ... Jboss ! Humm, well, why not ? They are sponsors of the Hibernate project, after all.

In the 3rd chapter, our fresh knowledge will be put to good use by starting the development of an online auction application called CaveatEmptor. This app will follow our reading progression and will grow bigger and smarter chapter by chapter. But for the moment, we are at the inception phase. What gives: a little bit of analysis, a stylish class diagram of the domain model and the resulting mapping file. And if you thought (based on 2nd chapter) that the mapping file is very intuitive and simple, you're in for a big surprise -- it is, indeed, intuitive and simple! Quite bizarre for an open-source project. As a matter of fact, the mapping file is one of the pivotal elements of Hibernate, since it addresses directly the O/R impedance mismatch, a recipe for transparent linking your POJOs and the constrained relational model. No wonder that a big part of this chapter is aimed at explaining why and how the mapping works in Hibernate. You'll see how class associations and inheritance translate at the metadata and mapping level. You'll start to understand the things that you took for granted in the previous chapter and you'll have that pleasant "uuh, I see" chain reaction. Hold on, it's just the beginning.

Because chapter 4 is going to explain once and for all the lifecycle of persistent object in Hibernate, their behavior from a persistence point of view as well as the available fetching strategies. And if you thought you already knew everything by heart from the documentation ... well, maybe you do know everything by heart. Nevertheless, it's very well synthesized in chapter 4 and I'll recommend it anytime to a coworker eager for Hibernate knowledge.

In the next chapter (the 5th) the rollercoaster slows down a bit. That is, if you already know the behavior associated with the four possible isolation modes in transactions, what are the different types of locking, what (the hell) MVCC means and the importance of transaction scopes. Chances are you already know some of this stuff quite well, but everybody needs a refresher from time to time, especially when it's well explained and when it comes with versioning and caching (1st and 2nd level) in Hibernate as a desert. By the way, I thought that OSCache supports clustering, not only SwarmCache and JbossCache, as stated in the book. There's even a thoroughly explained example of using JbossCache as a level 2 clustered cache for Hibernate, but it shouldn't be too hard to convert to other types of caching systems.

Now, if I were the author of the book, I would have placed chapter 6 before chapter 5. But I am not the author, which is quite fortunate for you dear readers since Christian and Gavin are much more competent than me at writing books about Hibernate (and probably at some other unrelated domains). They have decided to go back to mapping in chapter 6, after the short transaction/caching intermezzo. Well, they should know better... it's time for a serious dose of advanced mapping. This chapter is attacking interesting subjects such as custom mapping types (simple or composite) and (finally) the mapping of collections. Special guests stars: the whole gang of "sets, bags, lists and maps", together with explanations about their relational equivalent (associations, associations and associations !). Oh and yes "polymorphic association" (section 6.4.3) - I wasn't even aware that Hibernate is able to do that... guess I'm not that 'seasoned' (as a Hibernate developer) after all.

The 7th chapter is about "Retrieving objects efficiently" : about 45 pages for the 'retrieving' part and 6 pages for the 'efficiently' part. Fair enough ! You'll learn how to master basic HQL queries (parameters, pagination ...). You'll get a grip on the query by criteria API, as well as on advanced stuff such as dynamic queries, filters, subqueries and native SQL (very powerful). At the end of the chapter there's the Hibernate-specific solution for the n+1 selects problem, query caching and result iterators.

Following this wealth of useful knowledge, the 8th chapter starts a bit dry. Nevertheless, after a short introduction about Hibernate in managed environments, you'll find yourself again in the land of advanced programming techniques : application-level transaction implementation ! This is mostly new stuff (at least for me) - a great collection of best practices for transactional behavior management in industrial-quality apps. Somewhat unrelated but still interesting, the chapter ends with legacy schemas integration and a smart implementation example for audit logging.

The 9th (and last) chapter is about the round-trip development in Hibernate using the classical toolset : Middlegen and/or hbm2java and/or XDoclet. All the available techniques are presented in a very detailed, step-by-step manner.

Wait : don't close the book, there's more ! Ignore Appendix A (a short and rather uninteresting document about SQL fundamentals - that is, if you know SQL). Appendix B contains mildly un-fascinating ORM implementation strategies pour les connoisseurs (come on guys, I'm just a dumb user). But - Appendix C is a great collection of real-world stories and by all means read them all ! Especially the last one, a treasure of hard to find knowledge (no spoilers, please...).

In the end, I have to confess that there is something truly interesting about Hibernate In Action : albeit very technical, it reads astonishingly easy - and this kind of books is unfortunately very rare nowadays. My congratulations to the authors for this excellent piece of work - it was worth the wait.

As for you dear potential reader, if you already know all the information detailed in the book, I bow before you, great Hibernate wizard.

You can purchase Hibernate in Action from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

220 comments

  1. Hibernate? by Chuck+Bucket · · Score: 2, Funny

    well, I overslept Sunday morning, does that count?

    CBV*()$#

    1. Re:Hibernate? by Timesprout · · Score: 2, Funny

      Only if it was Sunday Aug 15th and you just woke up.

      --
      Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
      What truth?
      There is no dupe
    2. Re:Hibernate? by easter1916 · · Score: 2, Informative

      Hibernate is a persistence layer for POJOs (plain old Java objects). Basically a way to map objects to an RDBMS, and manage transactional persistence. See http://www.hibernate.org/ for more information.

    3. Re:Hibernate? by Anonymous Coward · · Score: 0

      Their website has already gone into hibernation, it seems...

    4. Re:Hibernate? by Chuck+Bucket · · Score: 1

      hopefully they're using a mac so they can have that 'pulse, pulse...' power button.

      CV@#$B

    5. Re:Hibernate? by ahdeoz · · Score: 1

      Java is a programming language. Objects are abstractions representing data and instructions. A RDBMS is a Relational Data Base Management System. Transactional persistence is...

  2. What is Hibernate ? by a3217055 · · Score: 5, Insightful

    What is Hibernate and what does it do ? I think the article failed to mention that can anyone please tell me what it means.

    Johnny English

    1. Re:What is Hibernate ? by Dan+East · · Score: 5, Funny

      All you need to know is it is well documented, in the event that you ever actually need to know.

      Dan East

      --
      Better known as 318230.
    2. Re:What is Hibernate ? by Jouser · · Score: 5, Informative
      From hibernate.org through google's cache:

      Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. Hibernate is an object/relational mapping solution for Java environments. The term object/relational mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema.

      Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities and can significantly reduce development time otherwise spent with manual data handling in SQL and JDBC.

      Hibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. Hibernate adapts to your development process, no matter if you start with a design from scratch or work with a legacy database. Hibernate generates SQL for you, relieves you from manual result set handling and object conversion and keeps your application portable to all SQL databases. Hibernate provides transparent persistence, the only requirement for a persistent class is a no-argument constructor. See our list of frequently asked questions about Hibernate.

      Hibernate is typically used in Java Swing applications, Java Servlet-based applications, or J2EE applications using EJB session beans. See this page for an overview of Hibernate application architecture.
    3. Re:What is Hibernate ? by FosterKanig · · Score: 0, Insightful

      That has to be the worst summary I have ever seen. Tell us what the fucking thing is.

    4. Re:What is Hibernate ? by grm_wnr · · Score: 1

      The link they left out(tm): http://www.manning.com/bauer

    5. Re:What is Hibernate ? by jonathanduty · · Score: 5, Informative

      Hibernate is a Java persistance layer. Basically, you can map java objects to a database schema (doesn't matter which one comes first). If I have a table called "user", I can create a java class called "user" (or whatever I want to name it) and use that class to access the database, without writing any sql. I've used a few different persistance frameworks and Hibernate is at the top of the game for now. If you are writing a java app that will access a database I highly suggest you take a look at it. Pure JDBC still has its place in the world, but Hibernate tends to make life a lot easer (and less messy).

    6. Re:What is Hibernate ? by grunt107 · · Score: 3, Informative

      Hibernate is purported to be a persitent object programming tool.

      This was grabbed off www.onjava.com:
      Hibernate will help us to painlessly store the data in permanent storage without too much hassle about choosing the kind of storage, installation, or configuration. Hibernate allows us to store any kind of objects; therefore, our application does not need to know that its data will be persisted using Hibernate. Of course, everything mentioned here can be applied in the opposite direction: fetching already prepared objects from a storage is now nearly trivial. Updating and deleting data is also available.

      Judging by their inaccessible website, Hibernate is what they do best.

    7. Re:What is Hibernate ? by someonehasmyname · · Score: 0

      I've got no clue either, but after a little googling, it looks like some soft of query language ("HQL") that is very similar to SQL, and can be used from within Java apps...?

      Anyone have more details?

      --
      Common sense is not so common.
    8. Re:What is Hibernate ? by Chuck+Bucket · · Score: 0

      oh, well if it's 'painless' then by all means, overdocument the hell out of it.

      LCB*$#@

    9. Re:What is Hibernate ? by Tailhook · · Score: 4, Informative

      (doesn't matter which one comes first)

      Actually, it does matter which comes first. Hibernate works best (best defined as most clean, simply) if you have the luxury of a well normalized schema where every table contains a surrogate key. Obviously, if you're working from a clean sheet this is an worthy design choice, relatively easy to satisfy.

      However, if you are working with a pre-existing design and you can't retrofit surrogate keys, you're in for a lot of additional leg-work with Hibernate. Getting Hibernate to function with composite keys forces extra coding and imposes limitations. This was my experience 9 months ago when I had a look at Hibernate for an "enterprise" application that must work with vendor schemas.

      I don't fault Hibernate; persistence is hard. Mapping an object from RAM to relational storage is much easier when you have a simple 1-to-1 relationship between objects and integers. Working well only with simple surrogate keys is not unique to Hibernate by any means. In principle you're correct; it doesn't matter which comes first. In practice, if you're dealing with composite keys or any form of denormalization you're in for a lot of pain.

      --
      Maw! Fire up the karma burner!
    10. Re:What is Hibernate ? by lpangelrob2 · · Score: 1

      Our company tried similar (closed-source) software. It was called Cocobase, but I don't really remember the company's actual name, if that was it. Five releases, one year, and countless problems later, it's still being yanked from our code. There were a few too many whacked out exceptions, objects not being updated, and places where code and schemas trying to talk to each other didn't agree. We reverted to basic JDBC, and I'm not really sure we're going to go back anytime soon while object mapping and persistence is in its infancy.

    11. Re:What is Hibernate ? by elmegil · · Score: 1

      Of course that assumes their website isn't slashdotted to hell. Care to answer the question, since it seems to be right now?

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
    12. Re:What is Hibernate ? by JASegler · · Score: 2, Informative

      I've had the misfortune to inherit a project that was written by someone who believed Hibernate is a persistence layer.

      Hibernate is tempermental at best and broken at worst. The biggest problem is it has it's own special language called HSQL which gets converted into SQL at runtime.

      HSQL is supposed to be database neutral. However, things don't work the way they are supposed to all the time. Specifically CLOB/BLOBs on DB2 for OS390 crash the OS390 JVM. Other things fail (sometimes silently) in unexpected ways. I suspect alot of the problems I have with hibernate are due to the fact that it's hard for most people to access a JVM running on OS/390 talking to DB2 on OS/390. Because of that hibernate apparently has little/no testing against that environment.

      Hibernate has more features than JDBC but in the end you still have to build out your real persistence layer code to handle all the parent<->child relationship things in your object hierarchies.

      I already have programs that will take a database schema and create the domain, broker and standard SQL statements for JDBC based persistence layers. Hibernate doesn't save any development time for me. And anyone else that has been doing java for a few years probably has the same sort of tools and it won't save them any time either.

      However, if you were starting from scratch, in an environment heavily supported by Hibernate it probably would not be a bad choice to go with.
      Just don't think it will magically do all the hard things like tracking updated/deleted/new objects, cascading auto generated keys from parent to child (or child to parent if your tables swing that way) or sequence delete/update/inserts to avoid referential integrity problems.

      -Jerry

    13. Re:What is Hibernate ? by Anonymous Coward · · Score: 0

      It's another rework of what EOModeller annd WebObjects have been doing for years

      Cayenne is yet another

    14. Re:What is Hibernate ? by Anonymous Coward · · Score: 1, Informative

      You may want to look at Cayenne. It handles mapping legacy databases much better than Hibernate, as it supports flattening one-to-one and many-to-one relationships, and also has a GUI for reading pre-existing DB metadata and subsequently configuring/generating your object structure. I used it to map an old, clunky Oracle 7 database to a nice, logical object hierarchy and it made everyone's life easier.

    15. Re:What is Hibernate ? by slashddot · · Score: 2, Informative
      Actually, compositite keys have been supported by Hibernate beginning with version 2.0, which came out over a year ago. See here.

      Usually, problems with mapping existing database schemas to Hibernate arise from the shorcomings of the database and not Hibernate. Oracle's CLOBs and BLOBs are a good example of this, as the methods exposed by the JDBC interface do not work properly and methods from Oracle's CLOB and BLOB classes must be used directly, breaking transparency and forcing the developer to do additional work.

      i.

    16. Re:What is Hibernate ? by Saeger · · Score: 1
      And the PHP equivalent would be PEAR's DB_DataObject. I gave it a try, but much prefer my SQL not being abstracted.

      --

      --
      Power to the Peaceful
    17. Re:What is Hibernate ? by smileyy · · Score: 1

      Just don't think it will magically do all the hard things like tracking updated/deleted/new objects, cascading auto generated keys from parent to child (or child to parent if your tables swing that way) or sequence delete/update/inserts to avoid referential integrity problems. Funny...hibernate did *all* of those things for me...

      --
      pooptruck
    18. Re:What is Hibernate ? by spitzak · · Score: 1

      I certainly agree. They could have mentioned what it is (something to do with making Java have data persistance). I would think to 90% of Slashdot readers "hibernate" is something laptop computers do when you close the lid.

    19. Re:What is Hibernate ? by aspinei · · Score: 1

      My review was written in the idea that everybody willing to read such a book already knows what Hibernate is all about. Of course, I failed to adapt it for the Slashdot readers, a target MUCH wider than the intended audience.

      My fault ! Everybody has the right to post a first crappy submission ...

      Next time, I'll be sure to introduce everybody into the depths of the subject. I mean, IF there's ever going to be a next time ... ... and what the heck is 'R' ?

      Adrian

    20. Re:What is Hibernate ? by JASegler · · Score: 1

      Now that's quite interesting..

      I double checked the current hibernate docs and there is no way to mark an object for deletion.

      Specifically look here

      p.getChildren().remove(c);
      will not remove c from the database; it will ony remove the link to p (and cause a NOT NULL constraint violation, in this case). You need to explicitly delete() the Child.
      Of course delete() is what actually deletes from the database.

      In the applications I usually write the user can do many things to the set of objects (multiple page round trips) and want them committed only when they hit that final save.

      And here is the kind of sequencing, parent<->child linking problem I have.

      Page->Group->TechSpec
      ->Products->TechSpecData
      Additionally there is a link between TechSpec and TechSpecData.

      The deletes have to go TechSpecData, Products, TechSpec, Group, Page.
      The inserts have to go Page, Group, TechSpec, Products, TechSpecData.

      And of course the key from TechSpec has to cascade to the referencing TechSpecData.

      Even if you ignore the fact you can't mark an object for deletion.. I can find no reference to controlling the order of the operations of children if you call saveOrUpdate.

      In the persistence layer I use I can mark groups for deletion, modify the page and other groups. And then with a single Page.save() get everything deleted, inserted, and updated.

      Under hibernate I found I had to use the essentially the same code to track and sequence things properly.

      But since all of these things were done by Hibernate for you..
      Just how do I mark an object for deletion during the saveOrUpdate?
      How do I specify the order of operation for the delete/insert/updates?

      Inquiring minds want to know.

      -Jerry

    21. Re:What is Hibernate ? by ahdeoz · · Score: 1

      Me too. But the appeal of Hibernate is in caching and blind persistence. We all have our own mapping/query building/pooling/dbconnection tools but the reason hibernate is worth paying the price of learning yet-another-xml-file-format-plus-a-not-quite-sql-q uery-language-plus-configuration-headache-plus-dep endencies is that it delivers on something that most of us really can't do that well ourselves, and it's not their mapping file format or their pseudo query language, it's the caching and persistence AI, that's really quite good.

      You learn how to use Hibernate, even though your own hacked together system is more intuitive and less dependent, but because it does a better job than your own does.

    22. Re:What is Hibernate ? by ahdeoz · · Score: 1

      ah but it does matter which comes first. Unless your tables have a one-to-one mapping with your objects. And then your fancy database is just a big fancy collection with a sort() function built in.

  3. A 400 page manual? by Weaselmancer · · Score: 5, Funny

    Jeez, with a manual that big it should be named coma.

    --
    Weaselmancer
    rediculous.
    1. Re:A 400 page manual? by Kjuib · · Score: 0

      If I could mod you up I would. That was the funniest joke I have seen in a long time!!! hahahahaha... I laugh at your joke.. and I laugh again.. hhahahhaha... you should get nominated for an Emmy for that one.

      --
      - Your stupidity got you into this mess, why can't it get you out? -Will Rogers
  4. What the hell is Hibernate? by Anonymous Coward · · Score: 1, Insightful

    Perhaps if you told us the purpose of the program/project in the first few lines, we might continue reading.

    1. Re:What the hell is Hibernate? by Anonymous Coward · · Score: 0

      Amen!

  5. So what is it? by bamf · · Score: 1, Redundant

    Would it be too much to tell us what Hibernate acutally is/does?

    1. Re:So what is it? by DA_MAN_DA_MYTH · · Score: 2, Informative

      It's a object relational persistence Manager for Java, kinda like JDO. Nifty little tool so you don't have to make your own persistence calls with JDBC, saves a lot of keystrokes. I bought the book and it shows a lot of different tricks, and with Hibernate's QBE (Query By Example), saves a ton of time debugging dynamic SQL Calls.

      I've been using this for quite a while, coupled with Spring you can write a lot of robust reusuable objects, if you utilize java's OO design methods.

      --
      "It takes many nails to build a crib, but one screw to fill it."
    2. Re:So what is it? by pebs · · Score: 0

      Would it be too much to tell us what Hibernate acutally is/does?

      Have all you people asking this been living under a rock??!?? It's an ORM (Object-Relational Mapping) tool for Java. Would it kill you to actually click a link?

      --
      #!/
    3. Re:So what is it? by dedalus2000 · · Score: 1
      Now what's Java again??? I know I've heard the term kicked around here and there. Could have been in some sort of advertisement. Can't recall where I saw it though.

      --
      My keyboads not woking popely.
  6. Hibernate is good, but I am using Prevayler more by MarkWatson · · Score: 4, Informative
    Hibernate is a very solid Java object relational mapping tool (I have a section on Hibernate in my last book). When you need OO to relational database mappings, Hibernate is my recommended tool, for sure.

    However, for my Java consulting business, Prevalyer is definitely my new "secret weapon". With a little care, it is easy to set up your POJO classes so that you can add class attributes without breaking your persistent Prevayler object store. Using Prevayler reduces development time. Good stuff.

  7. iPod pyramid schemes by Anonymous Coward · · Score: 0

    I'm so sick of "click my referrer link" lameness.

  8. What is it? by DaHat · · Score: 2, Insightful

    It always drives me nuts when I see a story about a given software package that talks about it's greatness... but that does not simply say what it is. This is made worse when the it's homepage which I'm sure describes the given package is /.ed.

    1. Re:What is it? by dAzED1 · · Score: 1

      so what do you think about people who can't just pull up a simple google cache?

    2. Re:What is it? by mccoma · · Score: 1
      It always drives me nuts when I see a story about a given software package that talks about it's greatness

      A thread of macslash.org about ReCycle generated some pretty funny posts based on no explanation of program function. It also generated some of the "it's so great that if you haven't heard of it your not worthy to use it" comments.

  9. By the way, if you've never heard of Hibernate... by Palshife · · Score: 4, Informative

    I really wish the story submitter would have taken a moment and put a one or two sentence explanation of what Hibernate is. It's not exactly a descriptive name, which I'll concede is common in our industry.

    Hibernate is an API for Java that uses Java Beans (get() and set() methods for all properties) to create, read, update and delete rows from a database. It's really cool. It's sometimes called JDO (Java Data Objects) but it's a dangerous association because of the Sun Reference Implementation of JDO, which is its own specification. Hibernate is different.

    --
    Attention deficit disorder is a complicated issue, spanning several major... HEY LET'S GO RIDE BIKES!
  10. book better than review, I hope by Russ+Nelson · · Score: 4, Insightful

    I hope that the book is better than the review. The reviewer starts off with the most basic assumption that ANYBODY with a CLUE knows EXACTLY what Hibernate is. Perhaps that's why hibernate.org isn't responding right now, because everybody read the top story, found no description of Hibernate, and clicked on the hibernate.org URL as the most likely place to find a description of Hibernate.
    -russ

    --
    Don't piss off The Angry Economist
    1. Re:book better than review, I hope by danharan · · Score: 1
      --
      Information: "I want to be anthropomorphized"
    2. Re:book better than review, I hope by Anonymous Coward · · Score: 0

      Oh, I don't know. The link to the Hibernate's home page could have gotton that information for the reader. Is your clicker-finger not working so well today?

    3. Re:book better than review, I hope by nzhavok · · Score: 1

      to be fair it was better than the 2 paragraph + contents listing reviews (which are moe like advertisments) on slashdot recently.

      --

      He who defends everything, defends nothing. -- Fredrick The Great
  11. whaa? by josh+crawley · · Score: 2, Funny

    This article just seems like a bunch of open source NewSpeak, I swear to god every time I try to read and understand what this is about my brain shuts down... quack quack RTFM quack quack OODB quack LGPL...

    1. Re:whaa? by Anonymous Coward · · Score: 0

      Penguins don't quack. You must be thinking about ducks.

  12. 150 words in the summary. by Anonymous Coward · · Score: 0

    Yet no mention of what Hibernate actually is. Great.

  13. Why hibernate? What's hibernate? by Hatta · · Score: 3, Funny

    It's a very well written introduction about why do we need ORM solutions in OO applications. The chapter explains the O/R impedance mismatch, while declaring quickly that OODB suck (immature and not widely adopted). Wel'll also find out that EJB also suck from a persistence point of view (for various reasons). Which can be quite a surprise knowing that Gavin is one of the authors of EJB3.0 specs. Or, on the contrary, this will explain a lot of things in the new EJB specs.

    Now that we have cleared the "why Hibernate" issue,


    Yeah... Cleared that right up. ORM? O/R Impedence? OODB? EJB? Little help here?

    --
    Give me Classic Slashdot or give me death!
  14. Pardon my ignorance... by Saint+Aardvark · · Score: 2, Funny
    but Hibernate's website is Slashdotted, and this review gives me no clue about what Hibernate might be.

    Rather than sharing my theories about a top-secret-yet-LGPLd government project to develop object-oriented Java-based SQL/graphics library that will allow us to train secret UFO pilots to defeat an invasion of alien accountants, would someone care to fill me in? I would be forever in your debt.

    1. Re:Pardon my ignorance... by danharan · · Score: 1

      An object-relational mapping framework that's quickly become very popular in the Java world. But please, don't let me stop you from sharing your theories about alien accountants :)

      --
      Information: "I want to be anthropomorphized"
  15. Slashdotted by SkippyTPE · · Score: 1

    a coma is what their webserver just lapsed into... thank god for the cache...

  16. No, I'm not new here... by cephyn · · Score: 1, Flamebait

    I mean mispellings in the comments is one thing, but if you are submitting an article for posting, spell check it! Jeez...I stopped reading once i hit "recipy"

    --
    Moo.
    1. Re:No, I'm not new here... by Anonymous Coward · · Score: 0

      You gotta love it when a grammar nazi misspells the word "misspellings".

      Kettle, meet pot....

    2. Re:No, I'm not new here... by cephyn · · Score: 1

      Hey, how about you meet irony and sarcasm?

      as I said I mean mispellings in the comments is one thing,

      but i guess that joke went over your head.

      --
      Moo.
  17. Curious why there's not more. by Amiga+Lover · · Score: 2, Insightful

    I think it's interesting there's not more really exceptional documentation for F/OSS projects.

    OSS Coders tend to have the fantastic attitude of always improving whats been written before, of making it better & better, revising, patching, rewriting, until an application becomes so damned useful there doesn't seem to be any other realistic choice.

    All well and good when it comes to coding - but where are all the documentation geeks to do likewise?

    1. Re:Curious why there's not more. by Anonymous Coward · · Score: 0

      > All well and good when it comes to coding - but where are all
      > the documentation geeks to do likewise?

      Fewer & further between, and if my experience is anything to go by in so much demand that finding paid work is trivial.

      And good documentation compilers are paid well.

    2. Re:Curious why there's not more. by Anonymous Coward · · Score: 1, Insightful

      Because writing code is a) fun, b) is relatively easy, at least for the sort of stuf you're talking about and c) scores you ego points. Very few people are willing to write documentation for fun. It's a thankless chore.

    3. Re:Curious why there's not more. by Anonymous Coward · · Score: 0

      > All well and good when it comes to coding - but where are all
      > the documentation geeks to do likewise?

      Spoken like someone who never reads source code. There's your documentation right there, automatically kept completely up to date by definition.

      Read it.

    4. Re:Curious why there's not more. by SnapShot · · Score: 1

      Those that do end up doing documentation well actually end up with a product that may be worth a few bucks. Coder's code for free but the documenters get a publishing contract with O'Reilly.

      --
      Waltz, nymph, for quick jigs vex Bud.
  18. Whoa.. by jx100 · · Score: 1

    I actually recognize Christian Bauer as the guy who developed the old 68k Mac emulator Basilisk II (..and I, I guess...).

  19. Huh by Anonymous Coward · · Score: 0

    Nice review, but it doesn't actually mention what hibernate is.

    I'm hibernating now (zzzzzzzzzzz)

  20. Re:the article by Anonymous Coward · · Score: 2, Funny

    doesn't explain what hibernate is, and the server's already /.ed. Damn. I guess I'll have to die without ever knowing.

    Maybe if you take a long nap the site will be back.

  21. Hibernate? by Anonymous Coward · · Score: 0
    From a documentation point of view, Hibernate ... offers a plethora of information,

    Except, of course, any explanation OF WHAT HIBERNATE ACTUALLY IS.

    (Jeeze people, is it too much to ask to give a one sentence summary of what a program does?)

  22. Re:Hibernate is good, but I am using Prevayler mor by pcraven · · Score: 5, Insightful

    I still prefer directly writing the SQL code myself. It doesn't take that long, and for many things it seems to be more efficient. I only pull the fields that I need.

    I have seen many applications where a developer will pull a list of objects out of a database and only use a small percentage of what was pulled. This was caused by a heavy persistence layer abstracting what was happening, and a developer that didn't care to find out.

    I seem to be in the minority with this view though. Automated persistence is quite trendy.

  23. What's in a name? by maztuhblastah · · Score: 2, Funny

    Usually I am able to BS my way through an article by making a guess based on the title. This article. however, posed a problem to me... I couldn't figure it out, or rather the decision I made wasn't that logical.

    Based on the info in the title, I concluded that the project did nothing (after all, a successul implementation of hibernation just sits there.) This caused me much confusion, resulting in me mistaking salt for sugar, and baking soda for non-dairy creamer....

    ...Remember kids, think before you post...

  24. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  25. Re:By the way, if you've never heard of Hibernate. by happyfrogcow · · Score: 1

    No kidding, this is the kind of crap that makes me wonder why i read /., because surely the editors don't read it. If they aren't interested in /., why should I be interested? This story is exactly where an editor should step in and offer a 2 line descrption of what the package is.

    At this point it's mostly the entertaining trolls that keep me comming back. The other stuff I can find elsewhere.

  26. Another project with a lot of Documentation by Necroman · · Score: 3, Funny

    "The R Project for Statistical Computing"

    http://www.r-project.org/

    This is an amazing stat program that is open source with a lot of documentation backing it up.

    Some of the documentation you can download:
    An Introduction to R (approx. 100 pages, 650kB)
    The R Reference Index (approx. 2300 pages, 12MB)

    Also, under their contributed documentation section, they have the documents sepearted by "Documents with more than 100 pages" and "Documents with less than 100 pages".

    --
    Its not what it is, its something else.
    1. Re:Another project with a lot of Documentation by Wills · · Score: 1

      Yes, that's even more than Hibernate's documentation. If you like R, try Albert Gräf's Q, a powerful functional/equational programming language which now has a set of Q multimedia examples including audio and MIDI based on a KDE interface.

  27. Hibernate Inaction by Sensible+Clod · · Score: 1

    ...

    *ducks*

    --

    The difference between spam and poop is that you don't have to dig through septic tanks looking for real food. -- Me
  28. Hibernate? by GodfatherofSoul · · Score: 1

    Why does Slashdot consistently post these kinds of stories with no context? Give us a little info on what it does, then we can decide quickly if it's a story we want to read.

    --
    I swear to God...I swear to God! That is NOT how you treat your human!
  29. Re:By the way, if you've never heard of Hibernate. by Otter · · Score: 1
    It is a bit ironic that some of the space the reviewer devoted to raving about the completeness of the Hibernate documentation could have been instead used to explain what the hell the software is. First I figured it was some sort of APM/ACPI module, then a documentation tool then I hit "The chapter explains the O/R impedance mismatch..." and gave up entirely.

    (Ok, maybe it's not ironic. After all the flaming from irony-obessed pedants, I have no idea anymore. But it's at least as ironic a rain on your wedding day.)

  30. Is there a doc in the house? by Doc+Ruby · · Score: 3, Insightful

    When people release source under L/GPL, you'd think they'd want people to use it, and contribute back. It's really hard to do that when the code is inaccessible for lack of documentation. Even reading code that is commented (a rarity) is no substitute for an overview - relying on "grep" is no way to trace codepaths or marshal APIs. At least CVS requires a note on checkin, even if it's usually a vague "fixed bugs". If you're not going to write your code starting with a first pass of all comments, with clear, consistent variable names, at least include a description of each code file's function in the grand scheme in its header, and usable README and INSTALL files for the whole project. Most important, have someone not on the design/code team read the docs for usability by a stranger. Beta testing the docs isn't hard, and you get to gloat about your brilliant achievements in words that don't have to compile.

    --

    --
    make install -not war

    1. Re:Is there a doc in the house? by Doc+Ruby · · Score: 1

      And then my Slashdot fortune at the bottom right of the page said "Fast, cheap, good: pick two.".

      --

      --
      make install -not war

  31. I am a tad surprised by Timesprout · · Score: 2, Interesting

    So many initial posts asking what Hibernate is when it is probably the poster child of Java Open Source (OK JBoss might be better known but unlike JBoss Hibernate is universally well regarded). Disappointing really.

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
    1. Re:I am a tad surprised by J+Mack+Daddy · · Score: 1
      I agree. Perhaps it is a testament to the greatness of Hibernate that the article poster/editors did not deem it necessary to mention what Hibernate actually is. I'd have probably made the same assumption (ie. that people would already know)...

      Not saying that's a good assumption, just noting that in some sense it reflects well on what is truly an outstanding example of open source software.

      --

      Jiggity

    2. Re:I am a tad surprised by rudedog · · Score: 2, Informative

      So many initial posts asking what Hibernate is when it is probably the poster child of Java Open Source (OK JBoss might be better known but unlike JBoss Hibernate is universally well regarded). Disappointing really.

      It sounds like this may come as a complete surprise to you, but not everybody is a Java programmer. Why should non-Java programmers be expected to know about a Java-only tool?

    3. Re:I am a tad surprised by The+Pim · · Score: 1

      Probably because the Java Open Source community has largely segregated itself from the rest of the free software/open source community by supporting only proprietary Java platforms.

      --

      The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.
    4. Re:I am a tad surprised by Anonymous Coward · · Score: 0

      It's no big surprise that no one knows what it is... everyone knows that Java sucks.

    5. Re:I am a tad surprised by Dachannien · · Score: 1

      Hibernate is universally well regarded.

      After reading some of the comments on this article, I'm thinking this might be a bit of a stretch.

    6. Re:I am a tad surprised by greenrd · · Score: 1
      It is not our job to workaround bugs in gcj etc. If our code fails due to a bug in gcj, it is the responsibility of users/developers of gcj to fix that, not ours. I have contributed bug reports to gcj but I don't see it as a major priority. I get paid to write code that works on the official Java platforms.

    7. Re:I am a tad surprised by The+Pim · · Score: 1
      I accept your position, but it sounds like you basically agree with me. You could have chosen to make free Java platforms a priority. If you had, you might have more recognition and support from the free software community. Also, you might have encouraged the wider adoption of those platforms, in which case they might be further along now. The same holds for any number of open source Java projects. (And personally, I think that anyone who cares about the long-term future of Java should support free Java to reduce their dependence on Sun.)

      You don't have to tell me about gjc et all not being there yet. I know it. I realize you would have had to do without a lot of useful features and put up with a lot of bugs. But if you made a committment to supporting gcj, I bet they would bend over backwards to help you.

      --

      The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.
    8. Re:I am a tad surprised by sonamchauhan · · Score: 1

      If only it was named JHibernate, this might not have been so JDisappointing.

  32. Hibernate in action by Anonymous Coward · · Score: 0

    It's really deceptive. It's like the computer is totally powered off! I can hardly believe it! But it starts right up where I left off. These guys should be commended for their efforts. I barely ever reboot thanks to them.

  33. Another example of good documentation is R by RealAlaskan · · Score: 1, Redundant
    The R programming language has excellent documentation, all written by the developers and users, including a newsletter and some contributed documentation, including a little reference card I wrote.

    The program is GPLed, and shows that excellent documentation is possible, if enough people.

    1. Re:Another example of good documentation is R by Wills · · Score: 1

      Thanks. That's a very handy quick reference card for R. Isn't R excellent software! By the way, does your version of LaTeX actually process files that end in .ltx? Mine only works if the suffix is .tex

    2. Re:Another example of good documentation is R by RealAlaskan · · Score: 1
      You're welcome.

      At home, I'm using whatever version of LaTeX is on Debian testing. Here at work, I use MikTeX. I know that the Debian version handles the .ltx extension just fine, but I'm not sure about the windows version here at work.

  34. Re:Hibernate is good, but I am using Prevayler mor by smcdow · · Score: 4, Funny
    Hibernate is a very solid Java object relational mapping tool (I have a section on Hibernate in my last book). When you need OO to relational database mappings, Hibernate is my recommended tool, for sure.

    However, for my Java consulting business, Prevalyer is definitely my new "secret weapon". With a little care, it is easy to set up your POJO classes so that you can add class attributes without breaking your persistent Prevayler object store. Using Prevayler reduces development time. Good stuff.

    Good Lord.
    This post, while informative, just makes me want to go to sleep. Or quit my job. Or both.
    Maybe I chose the wrong career.
    Are Java class mappings to databases really all that exciting?

    --
    In the course of every project, it will become necessary to shoot the scientists and begin production.
  35. Re:Hibernate is good, but I am using Prevayler mor by tanguyr · · Score: 3, Insightful

    nonsense, no human mind is capable of dealing with the immense complexity of SQL. Why, databases were just huge excel spreadsheets until smart OO developers figured out how to store... i'm sorry, of course i meant "Persist" objects in them. And don't forget the rallying cry of the modern developer: "the database is the bottleneck".

    /twisted & bitter

    --
    #!/usr/bin/english
  36. Re:By the way, if you've never heard of Hibernate. by Anonymous Coward · · Score: 1, Funny

    For the comments.

  37. Re:Hibernate is good, but I am using Prevayler mor by MarkWatson · · Score: 3, Informative

    I sometimes do the same thing myself (i.e., just write a little code using the JDBC APIs to grab what I need).

    Also: with Hibernate, you do have control over how much of a row of data you actually retrieve since you specify the mapping that you want in an XML configuration file.

    Do try Prevayler however: for some applications it really is a great tool. I especially like it for web applications where most data access is read only: caching objects in memory really speeds things up.

  38. Best thing since sliced bread by teutonic_leech · · Score: 5, Informative

    I have used Hibernate on the last two J2EE projects I've worked on and can attest to its simplicity and power. Although it'll take you a few weeks to really get the hang of how things work under the hood, it's well worth the learning curve. And it's ridiculously simple compared with EJB - that's for sure. My latest project even involved storing CLOBs to an Oracle Rack cluser - it took a bit of tweaking and research, but we saved ourselves hundreds of lines of codes and it performs without a glitch.
    Okay, I haven't RTFA, but the poster should also have made mention of Spring, which works hand in hand with Hibernate. Spring basically is an Inversion Of Control (IOC) framework, that allows you to define Hibernate transaction and session contexts. Spring also offers a great MVC layer, but one does not have to use that. If one chooses to just use Spring as an addition to Hibernate, one can look at Spring's additional functionalities as needed. Spring also offers Oracle BLOB/CLOB support by offering a customized OracleClobHandler - Oracle ONLY supports its propietary CLOB objects and won't accept java.sql.Clob objects via Hibernate.
    Generally, Hibernate is very non-intrusive and gives you the opportunity to write JDBC code alongside with your Hibernate code (which is super-elegant and abstracted the way it should have been done a long time ago). So, it can be slowly folced into an existing project without having to refactor any legacy code.
    The Hibernate user group is a bit rude to be quite frank - I've tried to post some questions in the dev group and got pretty angry replies. The 'beginner' group was not very helpful, so I had to google for answers. Of course there's the book, and I would strongly recommend to get it, since it is one of the major revenue sources for those Hibernate contributors. We want open source, but we can't expect to get everything for free, right? ;-)
    My first exposure to Hibernate was through the Appfuse framework, which is an excellent J2EE kickstart project, complete with ant built, Xdoclet, Hibernate, Spring, the works. I was even able to use XDoclet tags inside my Java beans, relieving me of having to write my Hibernate definition files by hand! It really doesn't get much easier than that. For anyone wanting to give Hibernate/Spring a try, I recommend to download the latest version of appfuse and give it a try - it's a liberating experience. The biggest kick I got was being able to seamlessly switch my project from Oracle over to MySQL by simply changing a few environment variables - I mean, how cooler can it get? :-)

  39. Sufficient docs rare? by ajs · · Score: 3, Insightful

    Hmmm, *looks on hard drive*...

    a 7000-word document on configuring ALSA drivers
    a 400,000-word document on using MySQL
    a 700,000-word documentation set for Perl (just the core, not counting add-on modules)
    6.5MB of Kernel docs
    27MB of Gnome help ... the list goes on, of course ...

    Nope, that's not a particularly outstanding trait. If he had talked about this documentation being well integrated with other, related documentation-sets, then I'd find that interesting (rarely is this the case in open source software), but it doesn't sound like it is.

  40. Link? What's a link? by Anonymous Coward · · Score: 0

    Re-read the article, paying close attention to the words printed in blue. Those are what internet gurus call "links". If you put your mouse pointer on top of a blue word and click the left button, the "link" will take you to another website that will tell you more about the blue words than you could ever fit in a slashdot post.

  41. Re:Hibernate is good, but I am using Prevayler mor by nvrrobx · · Score: 1

    I prefer writing it myself in small scale projects. For large scale projects, maintaining a bunch of different SELECT statements is just too time consuming.

  42. What their server is doing right now.... by Matrix_X · · Score: 4, Funny

    Hibernate is what their server is doing right now after the vicious slashdotting that it just received.

  43. Still too heavy by Anonymous Coward · · Score: 0, Offtopic
    Hibernate is still too heavy. If writing a bunch of config files isn't for you, consider Rails.

    Some related links, including links to reactions of people coming from Java to Rails:

    http://www.loudthinking.com/arc/000297.html
    http://www.loudthinking.com/arc/000291.html

    1. Re:Still too heavy by gorbachev · · Score: 1

      I tend to agree.

      That's why I use tools that do all that for you. Hibernate comes with a bunch of them, or you can use one of the excellent Eclipse plugins.

      --
      In Soviet Russia, I ruled you
  44. Re:Hibernate is good, but I am using Prevayler mor by Greyfox · · Score: 1

    I'm with you on that one. There's a lot of sloppy coding going on in the industry, and much of that is thanks to abstraction layers that let the programmer get away with not knowing stuff they really should know. The real irony is that these layers are not contributing to higher quality code (Since the programmers tend not to have the knowledge or experience that makes a good programmer) nor time to market (Because the team spends more and more time working around performance issues related to the abstraction layer, because they don't know enough about the underlying workings of the system to write efficient code.)

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  45. Re:What is Persistance ? by Anonymous Coward · · Score: 0

    If you've used a few different ones, you should know it's Persistence, right?

    I don't do this to be a jerk, I just want to help people to write better :) English is a very difficult language in the spelling x pronunciation issue, and native speakers seem to have more problems with spelling (since they usually first hear, and only later read the words) than non-native ones.

  46. They got Osama! by Anonymous Coward · · Score: 0
  47. Re:Hibernate is good, but I am using Prevayler mor by smileyy · · Score: 1

    No, they're not that exciting. But until recently, they've been a ginormous pain in the ass.

    --
    pooptruck
  48. The overview tells us nothing by frovingslosh · · Score: 4, Insightful

    Another lame /. article; what supposedly is an "overview" tells us nothing and is so full of TLA and such that you have to know what they are talking about to even make any sense of it. Clue for timothy: If you're introducing something new in a lead page /. article, it would be nice to actually tell people what it is, cutting through three letter acronyms and other buzzwords that can only be understood in context , which is missing when the reader has no reasonable expecation of knowing what the hell you are talking about!!!

    --
    I'm an American. I love this country and the freedoms that we used to have.
    1. Re:The overview tells us nothing by gtaluvit · · Score: 4, Funny

      What's a TLA?

      --
      - gtaluvit (prnc. GOT-tuh-LUV-it)
    2. Re:The overview tells us nothing by rpdillon · · Score: 1

      You're kidding right?

      Three Letter Acronym...

      =)

    3. Re:The overview tells us nothing by lscoughlin · · Score: 1

      ::boggle::

      if you've got a problem with ORM as a TLA then you've probably got a problem with CPU as a TLA as well..

      jesuxfscking chkdisk.

      --
      Old truckers never die, they just get a new peterbilt
    4. Re:The overview tells us nothing by Brandybuck · · Score: 1

      I'm astounded that there are people so anti-social that they boggle over the existance of others that don't know what "ORM" stands for...

      I'm guessing that not only does the poster live in his parent's basement, he lives in a padlocked CLOSET in his parent's basement.

      --
      Don't blame me, I didn't vote for either of them!
    5. Re:The overview tells us nothing by larkost · · Score: 1

      Three Letter Acronym... just in case you weren't kidding.

      For the more likely case that this was not straight: the proper quote was "What's a Nubian?"

    6. Re:The overview tells us nothing by easter1916 · · Score: 1

      It's the acronym for "Service Level Agreement", as pronounced by someone with a lisp (Thervice Level Agreement, geddit?)

    7. Re:The overview tells us nothing by Anonymous Coward · · Score: 0

      Come on now, we can't all be manly waste management specialists.

    8. Re:The overview tells us nothing by lscoughlin · · Score: 1

      hardly... i'm just...amused at by ignorance and it's desire to strike out at others whos compitence accidently highlights it.

      --
      Old truckers never die, they just get a new peterbilt
  49. Re:Hibernate is good, but I am using Prevayler mor by rycamor · · Score: 1

    Don't even try; your irony is lost on most of the O-O crowd. Many are doubtless reading your comments and nodding their heads sagely in agreement.

  50. Hibernate in Action by Hard_Code · · Score: 2, Funny

    Summary: zzzzzzzz

    --

    It's 10 PM. Do you know if you're un-American?
  51. Class::DBI by Anonymous Coward · · Score: 0

    Hibernate is as bloated and dumb as Java itself.

    Perl's Class::DBI is much sweeter!

  52. So, I'm the only one, huh? by tokachu(k) · · Score: 2, Insightful
    I thought "hibernate" was a power-management function.

    Actually, this entire article is proof of how...
    • ...program names are getting more pointless by the day (Hibernate?), and...
    • ...how most programs are mostly hype (more buzzwords than a Dilbert book).
    I'm sorry, but there's no excuse for the utter disregard to using common sense that was exhibited in the "hibernate" developers' group. People wonder why Microsoft can sell shoddy products. Well, I'll tell you why: they give them meaningful names (Word processing: WORD, Development studio: STUDIO).

    To the people at hibernate.org: you should be ashamed.
    1. Re:So, I'm the only one, huh? by Anonymous Coward · · Score: 0
      Um, I'm guessing they used the word "Hibernate" because persistence allows an object to "sleep" on disk in between process invocations or reboots ?

      Same reason that "Freeze/Thaw" is also an acceptable psuedonym for persistence.

    2. Re:So, I'm the only one, huh? by l3v1 · · Score: 1

      Right. When you can't find professional arguments against a perfectly usable and very nicely done project like Hibernate you start the old story on bad sw names.

      It's an old and boring disk alright, so not much use to start on that again.

      And no, I won't even start picking from the many dozen software names that don't have anything to do with their goals. Because I just don't really care. If you give me a usable tool you can call it pumpkin-pie-2k if you wish. It's your choice.

      Hell, does your name have anything to do with what you do ? :P

      --
      I am putting myself to the fullest possible use, which is all I can think that any conscious entity can ever hope to do.
    3. Re:So, I'm the only one, huh? by Anonymous Coward · · Score: 0

      Hmm. I'm trying to find some development tools. I want a good IDE, an optimizing compiler, and, heck, I'll even take a GUI layout tool. What have you got for that?

      What? Studio? What the heck's a studio?

      Or less sarcastically, what the heck does the word studio have to do with software development?

    4. Re:So, I'm the only one, huh? by Fnkmaster · · Score: 1

      Or pickle/unpickle, if you're kinky. Or a Python programmer.

    5. Re:So, I'm the only one, huh? by Anonymous Coward · · Score: 0

      "Hibernate" in this context refers to object persistance. That is, objects that are active "hibernate" to disk until they can be "woken up again". I'll grant that it isn't the best metaphor in the world, but it isn't completely random either.

    6. Re:So, I'm the only one, huh? by ProfKyne · · Score: 1

      YHBT -- criticizing open source programs for having names that have nothing to do with their function when in fact they make perfect sense, and then providing counterexamples from Microsoft -- don't fall for this one.

      --
      "First you gotta do the truffle shuffle."
  53. Where is that Murphies law article by barcodez · · Score: 1

    I'm working with Hibernate now and I desperately need to read the documentation to find out how to do something and you lot have gone and bloody /.ed the site.

    The doco is very good but I think some of it needs updating. A lot of it still refers to the hibernate.properties which I believe is deprecated in favour of xml configuration. For example I still haven't been able to get the SqlExport ant task to work with the xml conf even following the documentation - however I only tried for about 10 mins. I will RTFM when the site is alive again.

    --

    ----
    1. Re:Where is that Murphies law article by gorbachev · · Score: 1

      "I'm working with Hibernate now and I desperately need to read the documentation to find out how to do something and you lot have gone and bloody /.ed the site."

      Same here. Sucks big time.

      Might as well read some more /. then :)

      --
      In Soviet Russia, I ruled you
  54. Re:Hibernate is good, but I am using Prevayler mor by rycamor · · Score: 2, Informative

    Notice this quote by one of the Hibernate developers in an interview earlier this year:

    "I went into this knowing very little about ORM, and even very little about databases. One of my first tasks was to go out and buy a book to learn SQL properly. All my understanding of the problem comes from what our users have taught us over the last two years."

    Sigh... basing a product on secondhand experience from users who probably have never even learned what the relational model is really about.

  55. Hibernate's either been slashdotted... by jd · · Score: 1

    ...or it's in hibernation...

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  56. Re:Hibernate is good, but I am using Prevayler mor by William+Tanksley · · Score: 1

    Are Java class mappings to databases really all that exciting?

    Well, evidently not -- since the author was excited about Prevlayer, which isn't a mapping to a database.

    -Billy

  57. Re:Why hibernate? What's hibernate? by jd · · Score: 1

    The summary was co-authored by those gorrila chimps in an earlier story.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  58. Hibernate by Anonymous Coward · · Score: 1, Informative

    I program in both Java and .Net. For those people who wants to use hibernate with .net has a port of hibernate called Nhibernate.

  59. Re:Cheaper here by Anonymous Coward · · Score: 0

    You earn your living on slashdot?

    (Seriously, i'm seeing a lot of 'friendly' advice lately, are people getting paid for this?)

  60. Slashdot rewards good LGPL project.... by mr_z_beeblebrox · · Score: 1

    With an all expenses paid server meltdown. That will teach them to have hundreds of pages of quality documentation on line.

  61. Dude by Bill,+Shooter+of+Bul · · Score: 2, Funny

    If Hibernate is your poster child, you need a new child. Or poster. Or analogy. OR maybe its like a child poster on a milk carton. Have you seen this technology? It was last sighted in 2001 shortly after its birth.

    --
    Well.. maybe. Or Maybe not. But Definitely not sort of.
  62. Re:By the way, if you've never heard of Hibernate. by FortKnox · · Score: 1

    I think you oversimplified hibernate. Its an ORM. Its built to read xmls of files that map object fields to database columns (including complex relationships, such as one-to-many and many-to-many). Once that is done, persisting data to the database is quite simple with hibernate.

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  63. Re:Hibernate is good, but I am using Prevayler mor by Fnkmaster · · Score: 2, Insightful
    No offense, but the Prevayler site is pretty lame. I'm quite sure it's fast, but anybody who's written an in-memory system before knows that. Whenever your working data set is small enough to fit in memory, and your transactionality requirements force you to serialize processing at the application level anyway, your performance will be much better with a simple object-in-memory design.


    Anyway, the point is the site doesn't do anything to elucidate the limitations on ACID compliance, querying capabilities, etc. that you would expect from an object database system. Hell, they don't even seem to recognize that Prevayler is just a limited subset of an object database system (i.e. a memory-resident one). I'm glad somebody has written a reusable chunk of code to do this and all, but I wish the people doing it were more aware of the theory behind databases, and what trade-off decisions they were actually making so they could better document and explain them to their users.


    Anyway, if you are just comparing it to MySQL (hehe) I'm sure there are lots of great use cases for Prevayler, but when you compare it to a real RDBMS and look at real enterprise application usage scenarios, it's a bit of a different situation.

  64. Re:Hibernate is good, but I am using Prevayler mor by BJH · · Score: 3, Insightful

    Hahahaha. Good one ;)

    Don't forget, many modern developers haven't yet figured out that abstraction and performance are in an inverse relationship.

  65. Re:Hibernate is good, but I am using Prevayler mor by j3110 · · Score: 1

    Ok... I'm going to argue that the extra data doesn't matter. I know that doesn't make sense on the surface. For code that sits on the server to return data (Hibernate's market), it doesn't matter how much data gets returned. The pipe to the user is always smaller than the pipe to the database server. The biggest bottleneck is still the disk. Since the head is going to pass over the data anyhow, why not read it to put it in the cache? There's a decent enough chance to save a disk seek in the future if you happen to need that data.

    --
    Karma Clown
  66. Great review! by bsiggelkow · · Score: 1

    Wow, after reading what I consider an excellent review ... I was aghast that 90% of the posters were asking "Duh -- whaz Hibernate?" It was actually quite amusing. If a review helps me answer the question "Is this book worth the money?" then this review rates a 10. I didn't actually see anyone say this, so I'll say it. Thanks.

  67. How does it compare to OJB? by the_emmy · · Score: 1

    Since the website is slashdoted I can't read the FAQ. Does anybody know what's the difference between Hypernate and OJB? Is Hypernate better then OJB?

    1. Re:How does it compare to OJB? by rjshields · · Score: 1

      Does anybody know what's the difference between Hypernate and OJB?

      I'm not sure about Hypernate, but here's a comparison of Java ORM tools, including Hibernate and OJB.

      --
      In this world nothing is certain but death, taxes and flawed car analogies.
  68. 400 Pages! by Anonymous Coward · · Score: 0
    Who the hell wrote it? Neal Stephenson?

    Seriously, really thick documentation is a warning sign. Have you known any product or program with excessively large documentation not to be problematic? E.g. sendmail, any Microsoft product, emacs, etc...

  69. The impedance mismatch does (should) not exist by Phatmanotoo · · Score: 1

    It's a very well written introduction about why do we need ORM solutions in OO applications. The chapter explains the O/R impedance mismatch...

    I wish more people contributed with their POV on this discussion: do we really need Object-Relational mapping tools? What's wrong with having Object-Oriented applications work on a Relational-Data model? Why this modern insistence in that our business models have to be "fully OO"?

    You will hear many times that "OO has been proved to be better suited to build large applications". I sort of agree, but then there is even more evidence to support that the relational model is the best methodology for modeling data.

    IMO, when building large enterprise apps one can have the best of both worlds by applying each methodology where it really makes sense: model your data following the relational model; build your app following OO patterns and techniques.

    Again, in the context of Java: what's wrong with plain old JDBC? What's wrong with not having all my database entities objectified in the language? What's wrong about working with data and not objects?

    1. Re:The impedance mismatch does (should) not exist by ElDuderino44137 · · Score: 1

      There's nothing wrong with it,

      When one is building small applications that they never intend to maintain or grow.

      If you, however, want to build an application that has continuity from front to back, an application that can change and grow with little effort as requirements shift over time ... etc etc ... then OO is really the way to go.

      I remember about 10 years ago ... I was working on a RTOS using nothing more then C to develop a window manager for a amber terminal ... The fact that I was using C didn't keep me from implementing a system using an OO methodology. Later ... when someone asked me to add a new feature to the system. I did so in less then five minutes. It's those moments that really make OO worth it. All the time ... even with data ... which ... believe it or not ... Screen layouts and definitions turn out to be.

      I do agree that there is a disconnect between SQL and the OO model ... but that would be better solved by creating a single language to replace both SQL and OO (C#, Java, etc ...).

      Who's working on the next paradigm?

      Cheers,
      -- The Dude

  70. Maybe I'm confused... by grommet_tdi · · Score: 1
    In the next chapter (the 5th) the rollercoaster slows down a bit. That is, if you already know the behavior associated with the four possible isolation modes in transactions, what are the different types of locking, what (the hell) MVCC means and the importance of transaction scopes.
    ...but doesn't this describe a RDBMS? Why would I try to duplicate that functionality on the middle tier?
  71. Hibernate+Spring = Power by jonasmit · · Score: 1

    I have used Hibernate and Spring on a number of projects. Hibernate, of course, provides the abiltity to build POJO Data Transfer objects similar to JDO and others. Spring provides everything else. Really Spring just facilitates AOP, IOC (like most containers) and the ability to swap out all common implementations for another easily (for testing, change in philosophy, etc.). Spring also provides a better MVC layer than Struts (arguably) but allows you to use Struts or any other MVC framework you like.

    1. Re:Hibernate+Spring = Power by Anonymous Coward · · Score: 0

      What the heck do those acronyms mean? POJO? Wasn't he one of the Little Rascals?

    2. Re:Hibernate+Spring = Power by jonasmit · · Score: 1

      hehe
      POJO = Plain old Java Object (just data, getters and setters)
      IOC = Inversion of Control - essentially you inject control into the container rather than coding it directly. This is a design pattern embodied by the Spring framework that lets you inject the appropriate control as long as you follow certain standards so that practically everything can be swapped out later for different implementations

    3. Re:Hibernate+Spring = Power by jonasmit · · Score: 1

      oh yeah
      aop = Aspect Oriented Programming. This is an extension of the OO language to allow crosscutting or writing logic across many or all of your classes rather than doing the same type of thing in each object. Great for logging, security and for modifying the behavior of packaged code that you don't want to open up or cannot open up. As long as you have the jar and a javadoc you can alter the classes provided.

    4. Re:Hibernate+Spring = Power by Anonymous Coward · · Score: 0

      (just data, getters and setters) - You mean 'bean'?

      Pojo's are just that, plain java objects, and can do whatever they want.

    5. Re:Hibernate+Spring = Power by zaqattack911 · · Score: 1

      Any good spring example / tutorials? I've been reading the docs, and its waaay too much info at once :) Where can I find info on starting a SMALL webapp with spring from the ground up? I would use its IOC, and MVC with jsp.. but wtf is Aspect Oriented Programming?

  72. Python equivalent is by Anonymous Coward · · Score: 0

    MiddleKit for Webware. Supports mapping to MySQL or Postgres.

  73. Where's the introduction to the review? by StateOfTheUnion · · Score: 1
    The first chapter, in the good tradition of all first chapters in the world, is an introduction. It's a very well written introduction about why do we need ORM solutions in OO applications.

    It's ironic that the reviewer acknowledges that introductions are a "good tradition" but then fails to write an good introduction himself . . . I like many had no idea what Hibernate is until I read some of the posts by gracious /.'ers that took the time to post a description of Hibernate. Additonally isn't it good writing style to define your jargon acronyms before using them like this: Object Oriented (OO) or Customer Relations Management (CRM)? The author completely fails to do this.

    Why didn't the reviewer do that? I can only suppose that his box is so small that he didn't know that many regular /.'ers have no idea what he is talking about. And I can only guess that the /. editor that posted this and failed to give a description of Hibernate is living in the same box. . .

  74. you should know by mixmasterjake · · Score: 1

    Hibernate is probably not the type of thing that you would know about unless you are doing larger enterprise development in Java. You can use it for simple apps, but it probably just adds a bunch of unecessary bulk and complexity. If you're working on a large system, it can do a lot of the boring, tedious work for you.

    I was fortunate enough to work with a client that dedicated one of our developers to researching Hibernate. He gave us a little presentation with his findings.

    Basically, if you find yourself writing object wrappers around your database objects, then Hibernate will potentially save you some time. You don't have to think about the mundane details of mapping fields. Hibernate lets you define everything in configuration files and then it takes care of the data access functions. You can tell it about your primary keys, foreign keys, constraints, etc. It will enforce everything. If you do it right, you don't have to write SQL code to interact with the database. It's all done under the hood.

    In keeping with the name hibernate, it also persists objects in memory and grab them from the database "automagically" as needed. So, that gives you some level of caching without your having to think about it. When you get a new instance of, say, customer object #1, Hibernate may populate it from the database. Or, it may grab it from memory. You don't need to know. It is smart enough to deal with transactions as well, although I haven't looked very deeply in to that aspect. It handles just about every other annoying situation you can imagine having to do with the plumbing.

    Like a lot of developers, I'm protective about handing off important control over my app to a third party component (or set of components). If you are not comfortable, Hibernate is probably not for you.

    The verdict of our team is that we will be implementing Hibernate in our next major development effort. So, I will be deep in it soon!

    --
    TODO: come up with a clever sig
  75. Re:Hibernate is good, but I am using Prevayler mor by John+Courtland · · Score: 3, Funny

    But with all this new hardware and great software running on it, we don't have to worry about silly things like memory usage and performance tuning anymore! The magic box does it for us!

    I just made me sick :(

    --
    Slashdot is proof that Sturgeon's Law applies to mankind.
  76. 400 pages about a snooze function for laptops? by Trogre · · Score: 1

    Anyway, I think we just sent their site into hibernation...

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  77. Not trolling in a java story, but .. by flipflopflip · · Score: 1
    Another example of excellent documentation is python (http://www.python.org/). Clearly presented, accurate, well organized and indexed, but most important of all: well written.

    Information is presented in bite-sized chunks matching the 'fits your brain' philosophy that is one of the reasons that make python attractive.

    Tip top job Guido, Fred Drake et al.

  78. Its good, but look at JDO as well by Decaff · · Score: 1

    Hibernate is a superb product, but has some disadvantages: Firstly, it's a non-standard API. This may, or may not, influence a developer's decision to use it, but anyone looking at using an object-relational mapper might also look at JDO (Java Data Objects), which is a standard, and has many competing versions, both commercial and free. A new specification for JDO, version 2.0, is about to be published, which has most, if not all, the features of Hibernate, including many additional aspects which are unique to JDO. Most JDO suppliers already provide these features.

    Another consideration is that JDO tends to be more scalable for very high volume database work - for example, single transactions involving thousands of records. Although this kind of work can be done with Hibernate, its not recommended, whereas JDO (especially version 2.0) has functions for highly sophisticated cache management, object state control and 'fetch group' settings that allows such high volume work to be done without excessive memory use.

    1. Re:Its good, but look at JDO as well by chochos · · Score: 1

      AFAIK, JDO 2.0 is based on Hibernate. The "new" query language that comes with JDO 2.0 is based on HQL (Hibernate Query Language). They did this because Hibernate is the most popular Java ORM out there, and this time I think it was a good decision to base the new standard on an existing open source framework, rather than reinventing the wheel and coming up with something lousy.
      I hope someday the EJB stuff becomes easier to deploy, maybe they can take some ideas from Spring, to allow for more container-independency.

    2. Re:Its good, but look at JDO as well by Decaff · · Score: 1

      AFAIK, JDO 2.0 is based on Hibernate.

      It isn't. It has fundamental differences - cache management is different, there are many more object cache states (e.g. hollow) than in Hibernate.

      The "new" query language that comes with JDO 2.0 is based on HQL (Hibernate Query Language). They did this because Hibernate is the most popular Java ORM out there, and this time I think it was a good decision to base the new standard on an existing open source framework.

      There is no new query language with JDO 2.0 - its simply an extended version of JDOQL as in JDO 1.0. There are far more facilities, but its nothing at all like HQL.

      You may be thinking of a new standard for java object persistence which is being worked on in as part of EJB. This will combine features of both JDO 2.0 and HQL. However, this is many years away.

      By the way - Spring has good integration with JDO as well as Hibernate.

  79. OT: Agila and BPM by ed1park · · Score: 1

    Can anyone give an explaination of BPM and the Agila BPM engine and lend some insight into the significance of this?

    http://www.infoworld.com/article/04/10/04/40NNbl ue code_1.html

  80. MOD PARENT UP by hopethishelps · · Score: 3, Insightful
    This article just seems like a bunch of open source NewSpeak,

    You're right, there is no information in the article. It doesn't even tell us what Hibernate is. The blather is also peppered with undefined acronyms - ORM, POJO, HQL.

    And some idiot moderator modded parent down as a troll. Sigh. It's not a troll, it's a valid and accurate criticism of a really crap article. Crap is, unfortunately, becoming the Slashdot-article standard.

  81. Re:Why hibernate? What's hibernate? by Anonymous Coward · · Score: 0
    Yeah... Cleared that right up. ORM? O/R Impedence? OODB? EJB? Little help here?

    Couldn't you have read a few lines further, you insensitive clod? He explains all that: it's "a recipe for transparent linking your POJOs" and generating "basic HQL queries". What could be clearer?

  82. Re:Why hibernate? What's hibernate? by easter1916 · · Score: 2, Informative
    • ORM = Object-Relational Mapping, that is, a framework for persisting objects to a relational database.
    • O/R Impedance = The problems and technical difficulties associated with Object Relational mapping.
    • OODB = Object-Oriented Database, as opposed to an RDBMS (Relational Database Management System), i.e., a database that supports objects natively.
    • EJB = Enterprise Javabeans (see java.sun.com for an explanation of these monstrosities).

    I hope that helped.
  83. Shouldn't that be... by Jeremiah+Cornelius · · Score: 1
    Hibernate Inaction?

    C'mon! "Hibernate in Action" is an oxymoron of biblical proportion.

    --
    "Flyin' in just a sweet place,
    Never been known to fail..."
  84. Hibernate is dying.... by Anonymous Coward · · Score: 0

    I'm sorry to hear that it is so throughly documented, as it will now join the ranks of FreeBSD and slowly die (if you believe the netcraft trolls).

    But seriously if a project is to be weighed by the volume or quality of its documentation, I'll refer you to the FreeBSD Handbook, man pages, USENET groups, mailing lists, and Greg Lehey's excellent books.

  85. So if it takes a few weeks to learn... by narl · · Score: 1
    ..and the user community is hostile, and any developer working with a database who is worth anything already knows SQL, what's the point?

    Besides buzzwords, I mean.

    I'm tired of all these endless wrappers and frameworks that just keep stacking up. The lower level stuff is usually easier to learn (and more reusable) than all these wrappers that change by the week.

    1. Re:So if it takes a few weeks to learn... by teutonic_leech · · Score: 2, Informative

      Not true. It took me a LOT more time learnng how to write good JDBC code, that didn't break in an enterprise enviornment. Had I had access to Hibernate back then, my life would have been infinitely easier. Finally, Gavin actually offered a cash price for anyone writing manual JDBC code which would be faster than Hibernate - so far nobody has come to collect it.

  86. If you use Ruby, try ActiveRecord by Anonymous Coward · · Score: 0
    If you think Hibernate is the ultimate in ORM systems, or that 50 pages of documentation are necessary before you can get started, you might want to take a deep breath and look into ActiveRecord for Ruby.

    Here's how to set up the class for a Customer:
    class Customer
    end
    Yup, that's it. It reads the definition from the database and creates the appropriate accessors dynamically. How long does that take with Hibernate?

    Now let's add an Order object, and tie it to the customer.
    class Order
    belongs_to :customer
    end
    class Customer
    has_many :orders
    def name() "#{last_name} #{first_name}" end
    end

    c = Customer.find_first "last_name = 'Smith'"
    if c.has_orders?
    puts "orders for #{c.name}:"
    c.orders.each { |o| puts "order #{o.id}" }
    end
    Pretty cool huh? Unless you get paid for the hour, why wouldn't want this in your own projects?

    Come in from the cold, try Ruby!
  87. Re:Why hibernate? What's hibernate? by Tim+C · · Score: 1

    Bingo!!! What do I win?

  88. Hibernate+Spring+Tapestry = MORE Power by chochos · · Score: 1

    Check out Tapestry (part of Jakarta) for a much better web framework than Struts. Integrating these 3 frameworks results in a very nice architecture that allows you to write J2EE applications that can be very container-independent.
    Spring allows you to put together your UI code, your persistence code, and your business logic together, without the need to tie any layer to the other ones.

  89. Yet Another Object Relational Mapping Framework by stefaanh · · Score: 1
    I don not want to start a "this is better than that" discussion, I simply want to add something of my experience to this topic, because good ORM can be a time or life saver for any project.

    I have some experience with EOF (Enterprise Object[1] Framework) and was looking at Hibernate. Now i'm using Cayenne[2]. There is not so much difference between the two latter, taking simplicity and elegance into account. But here is why we choose Cayenne for our situation:
    - a friendly open userbase
    - a project which got its priorities right
    - it resembles, and, can import the model files of EOF
    - it reverse engineers existing databases with ease.
    - I get a *great* cross platform modeling/mapping GUI tool which saves me lots of work.
    - I could write my own database adaptor by subclassing the work already done.
    - inheritance is used to separate business logic from persistence and mapping logic. You never need to touch the latter.

    etcetera...

    From the Cayenne website:
    Bill Dudney posted a Cayenne vs. Hibernate[3] entry in his blog. This ended up as a pretty long thread discussing the merits of GUI tools for ORM among other things.
    It is interesting because Bill fooled around quiet a bit with the frameworks, and you get a quick idea of what your code will look like in both. Also it gave me the right strategic insight.

    The main maintainers of Cayenne got there first with
    a good introduction to their creation[4].
    Another quote: Unfortunately popular feature-for-feature comparisons[5] of such frameworks provide as much information about the substance as nutrition labels about the food taste. So this is a bit like choosing a dish in a restaurant - its all about the flavor.
    1. http://developer.apple.com/documentation/WebObje cts/Enterprise_Objects/Introduction/chapter_2_sect ion_1.html
    2. http://objectstyle.org/cayenne
    3. http://www.theserverside.com/blogs/showblog.tss? id=CayenneAndHibernate
    4. http://www.theserverside.com/articles/article.ts s?l=Cayenne
    5. http://c2.com/cgi/wiki?ObjectRelationalToolCompa rison


    Evolution will tell. But this is my bell.
    --
    --------
    * Sigh *
  90. Re:Hibernate is good, but I am using Prevayler mor by fforw · · Score: 1
    performance lost? OMFG..

    let's spend 2 years rewriting all business logic in assembler...

    --
    while (!asleep()) sheep++
  91. hibernate blows by Anonymous Coward · · Score: 0

    Take a pojo that has a set or a list. Load the object with the load command. Make sure the list gets loaded through the relationship mapping. Take the returned object and copy it to a new pojo with BeanUtils.copyProperties. It doesn't work. It craps out on the list or set. Why? because your hibernate object is not really a pojo. Its a proxy to a pojo. Same issue with at least on xml writer. Pass the hibernate object to it and it craps out.
    Try and figure out what flush, update and saveorupdate actually do from reading the documentation. Try and understand the cats, Cats, kitten, cat, Cat mess from the examples. The documentation is aweful.
    Hibernate isn't super horrible. But I am sick of fanboys of api's expressing how great something is when there are clearly some ruff turds.

  92. Perl equivalent is... by Black+Perl · · Score: 1

    The Perl equivalent is Class::DBI. This is quite a good module for working with databases, as it can save you from writing a lot of code. This article discusses the power of Class::DBI combined with the Template Toolkit, the best pure-MVC templating system there is. Maypole is a system built around these two modules that lets you create a complete Web-based database interface in as little as ten lines of code! Another Maypole article is here.

    --
    bp
  93. Re:Sad news: Christopher Reeve dead at 52 by fyngyrz · · Score: 1
    Other than heart failure from bead sores...

    Say... what are you insinuating he was doing with those beads?

    --
    I've fallen off your lawn, and I can't get up.
  94. Re:Hibernate is good, but I am using Prevayler mor by Eneff · · Score: 1

    If ten thousand dollars in hardware saves me 200 hours, between development time and maintenance, then the abstraction is more than worth it.

    On the other hand, that might not be the correct tradeoff in a desktop application.

  95. Re:Hibernate is good, but I am using Prevayler mor by Tablizer · · Score: 1

    The biggest bottleneck is still the disk. Since the head is going to pass over the data anyhow, why not read it to put it in the cache?

    Most RDBMS do some caching already, I would note.

  96. Re:Hibernate is good, but I am using Prevayler mor by Tablizer · · Score: 1

    I prefer writing it myself in small scale projects. For large scale projects, maintaining a bunch of different SELECT statements is just too time consuming.

    Why? SQL is a relatively compact language (if you use it right). Putting wrappers around it only makes more layers, red tape, and interfaces to have to dig around change.

    (I agree that SQL is not the ideal relational language, but it may be decades before a replacement standard is accepted.)

  97. Re:Hibernate is good, but I am using Prevayler mor by Tablizer · · Score: 1

    However, for my Java consulting business, Prevalyer is definitely my new "secret weapon".

    Prevalyer will lock you tightly to Java. Sun might like this, but data tends to outlive languages in the longer run I would note. I don't see how getting locked to Java is an improvement over getting locked to say Oracle. Plus, the Prevalyer tends to assume the relational model is bunk, which triggers a nice holy-war between OO heads and relational heads.

  98. acrncon by RodeoBoy · · Score: 1

    http://www.swcp.com/info/essays/acrncon.htm

  99. There's more by r6144 · · Score: 1
    Many GNU programs are very well documented, such as Emacs/XEmacs, gcc, glibc, gmp (a multi-precision computing library), gsl (GNU Scientific library). Just read the info page, or if you want something prettier, grab the TeXinfo files in the source package and make a PDF version.

    It depends on the popularity... if a library becomes very widely used, its documentation will improve by itself. GTK documentation had been almost nonexistent during the 1.x days (just a tutorial), but now it is mostly acceptable, albeit still not very complete, thanks to so many people needing it.

  100. My ORM by militiaMan · · Score: 1

    So many ORMs it's not even funny. I was so frustrated that I just wrote my own. As a result I found out it's just a bunch of bs. A simple ORM is simple. It only take a few hours in Java to create and understand a ConnectionPool. Yea I know I could have saved a little time coding less and using really cool database modeling GUIs, but I like writting code and knowing what is going on behind the scenes.

    Leave pre-packaged ORMs to large corporations and begineers so they can confer with their minions.

    1. Re:My ORM by easter1916 · · Score: 1

      There's a LOT more to an ORM than connection pooling...

    2. Re:My ORM by Da+VinMan · · Score: 1

      No kidding.... I mean, when your ORM actually lets you traverse your database relationships using simple Java object tree navigation, and you don't even have to write the code for that, you start to understand what ORM could be.

      At the very least, I would be a very happy guy if I could stop writing a Java class file for every freaking table in our system. If I want relationship navigation (example: 1 person to 0-n addresses), I get to write that too! Lucky me... No, I don't have a choice. Yes, I have tried to get it changed.

      Don't get me wrong, I love my work; but there is a smart way to get work done, and there is an unnecessarily difficult way to get work done. I'm just in favor of the smart way.

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    3. Re:My ORM by militiaMan · · Score: 1

      What do you think is the easiest code generation tool? How much time do you think it saves? Personnally I have been thinking of adding ORM to ArgoUml, but I don't think it would save me the time required to add the code.

    4. Re:My ORM by Da+VinMan · · Score: 1

      Well, I haven't done a complete survey of the various ORMs out there. I'm sure that there are quite a few choices that would be worthy of integration into ArgoUML. That said, I'm sure that Hibernate, Cayenne, and Sun's JDO would all be worthy of consideration.

      As far as the time it would save, I'm not sure that adding those tools into ArgoUML would save time at all. They all kind of do their own thing according to their own model. The productivity benefits of trying to have those models appear in ArgoUML aren't immediately apparent to me. In the case of Hibernate, to name the example with which I'm most familiar, you could certainly import the generated classes into ArgoUML to get them into the diagrams. But, it's not like you'll be changing those classes from within ArgoUML. After all they are generated by Hibernate and, if you stick entirely to Hibernates generative facilities, you won't be maintaining those by hand anyway.

      As far as how much time tools like Hibernate save, I would have to say "substantial". Whenever I have a new page to add to my current system, I easily spend over half my time dorking around with the code that accesses the table structures. It would be a god-send to just make any changes I need to the tables, re-gen my database layer code, then proceed with the business logic classes that sit on top of those db layer classes.

      The ORM "wheel" has been re-invented many times. I have a gut level repulsion to writing yet another version of that wheel for future systems. Any system I work on WILL need a database layer and none of them are particularly unique as to their needs. After all, I don't write my own UI widget library every time I write a new application.

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    5. Re:My ORM by militiaMan · · Score: 1

      My mistake. I meant to put my ORM (that i wrote), and not just ORM. I was trying to focus on the two questions. Although, you did mention a generation tool for Hibernate. Is it a UML tool so I don't have to use two code generation tools?

      My hope if I get the time would be to integrate my ORM with the code generation portion of a UML tool. I guess I would just make a special entity class widget that would generate the required classes like db modeling GUIs without breaking things up between a data modeling tool and a UML tool.

      I currently just type everything in, but I would have to do all of the following to Argo:

      * Add Special Widget
      * Add XSL and transform the XML data that represented the Special Widget a few times to create the needed classes
      * Add a parser to read the java files back into the UML tool

      I estimate that it would take 40 hours worth of work. To save me 1 hour per iteration (~every 3 months). So I would save time by the 120th month, but I would get a pretty GUI to show off and give away as a ORM tool with UML.

  101. Could everyone hang on a minute? by aftermath09 · · Score: 1

    Just a few comments from a Java developer that has used an old version of hibernate, and hence actually understands what this article is about:

    1) Please don't flame the reviewer so much, he's actually done a good job. I personally will buy the book now that he's given the review.

    2) Hibernate is a Java based object relational mapping(ORM) tool. ORM deals with the transition on the persistence layer between a database and using the object classes within your program. Where this saves u time is in dealing with type conversions (for instance), but also because with good ORM utilities (like JDO - java data objects) u don't need to write any SQL or stored procs.

    but wait, u say, I don't mind writing these! well, when you are dealing with larger projects, it's much easier for a tool to generate the tables or classes for u and just called object.persist() rather than writing lines and lines of code that do essentially the same thing.

    3) JDO is an alternative to Hibernate for ORM. unlike Hibernate, JDO is a standard api laid out by Sun, with different providers like kodo. I think the original story goes Gavin King thought JDO sucked so he wrote his own ORM tool.

    4) What about performance? Hibernate insist that their product is fast - no objections to the contrary here. Using JDO, most providers optimize their sql to match the database type. On the whole, performance is not bad, but the strengths of these products lie in point (2).

    there u go. hth.

  102. Re:By the way, if you've never heard of Hibernate. by rjforster · · Score: 1

    Maybe the /. users should be allowed to moderate stories as well as comments.

    Eg, we could see
    -5 Story
    -2 Intro explains nothing about the topic
    -3 Duplicate
    -1 KDE/Gnome flamewar contained within[1]
    +1 It's about some interesting new software that you might like to know about.

    and set our thresholds accordingly (by story category if necessary), complementing the user homepage story category preferences.

    No, I'm not going to code it myself, not itchy enough for me to scratch.

    [1] Insert chosen flame/complaint etc that we've all read a thousand times.

  103. Vs ibatis? by sadiklis · · Score: 1

    What advantages Hibernate offers over ibatis sql maps?

  104. Re:Hibernate is good, but I am using Prevayler mor by ahdeoz · · Score: 1

    When they say "the database is the bottleneck" they mean disk seek. That's write. Reading/Writing to disk. That fundamental archaism that so many have forgotted. The DB is (suprise!) an abstracted data persistence mechanism for reading and writing to disk with things like caching and mapping between records.

  105. Re:Hibernate is good, but I am using Prevayler mor by ahdeoz · · Score: 1

    Unless the xml configuration file looks something like this:

    <?xml version="1.0"?>
    <!DOCTYPE QUERY [
    <!ELEMENT QUERY (#PCDATA)>
    ]>
    <SQL>
    <!-- your query here -->
    </SQL>

    It isn't going to match the power (or simplicity) of SQL. As a matter of fact, this is a pretty good sample if you throw a QUERYID attribute and maybe some other metadata and let the database handle what it does.

  106. Re:By the way, if you've never heard of Hibernate. by ahdeoz · · Score: 1

    I thought it was a fairly good book review. But I know what Hibernate is. Anyone who would read the book should, though it should probably have mentioned JAVA in the summary paragraph. A good rule of thumb is, if you seem more than 4 acronyms in a book review that you don't understand, it's probably not something you're likely to be interested in.

  107. Re:Hibernate is good, but I am using Prevayler mor by mpcooke3 · · Score: 1

    I have worked for a place where the database was the application and for another place where the OO model is the application.

    Developing, refactoring and testing changes to an OO model is much easier than one with a relational database back end.
    The OO model is also much easier to conceptualise - especially once the logic and data get's beyond a certain level of complexity.
    It's generally easier to get better performance in the OO system for a lower hardware/development cost if the model fully fits in memory - especially if business requirements change rapidly.

    Example:
    In OO you can ask a house object how many people are in the livingroom and if you can't you can neatly add a method the house object for other people to use in the future.

    In SQL you need to join the house to the livingroom and then to the people via the location table and then it takes too long so you need to use a query planner only to discover that maybe you are going to need to store a cached denormalised people-location table because you have already created the best indexes. Then next week there is a schema change and it breaks half the queries in the system. It takes on average about 10 mins to understand each query written by someone else and rewrite it.

    My point?

    You get some stuff free from a good database - persistance, transactions, roll-back, generic querying, etc, So if I have to put a small system togethor quickly a database is ok, but for bigger systems with fast changing requirements they aren't so great.

    Matt.

  108. Re:Hibernate is good, but I am using Prevayler mor by tanguyr · · Score: 1

    When you ask this house object about the number of people inside it, it asks all its own rooms (livingroom, etc) how many people are in them, and then adds all those numbers together and returns the result to you - in other words it jumps through many of the same hoops you ascribe to the SQL solution. You, the developer, jumped through those hoops (usually one at a time) when you were designing the house object and the abstract room type and so forth, but now you can just say house.getNumberofPeople and it magically works. If you never reused queries, then sure your critique is valid, but since you can always write a stored procedure called GetNumberofPeople(houseid IN INTEGER, numberofpeople OUT INTEGER) (with no procedural code in that proc either) the difference is not that large.

    Before we go any furthur, i'm not trying to be one of those grouchy old men who roam the corridors of corporate IT and tell everybody that COBOL was the be all and end all of languages and that everything since has been just useless masturbation. I completely agree that objects are a useful way to more freely and accurately model concepts in the real world than the tables and relations of RDBMS's. I'm just reacting to the kids roaming those same aforementioned corridors claiming that if it ain't (insert language, pattern, or other technology du jour here) then it's obviousely "not the right way to do things".

    BTW: whoever moderated my origial post Insightful is either on crack or is engaging in some truly brilliant meta-trolling.

    --
    #!/usr/bin/english
  109. It's all in the name by rjshields · · Score: 1

    Hibernate - persisting something to a data store is like hibernating it. It makes sense.

    program names are getting more pointless by the day ... but there's no excuse for the utter disregard to using common sense

    You're quite right - and your post in nonsensical.

    --
    In this world nothing is certain but death, taxes and flawed car analogies.
  110. Re:Hibernate is good, but I am using Prevayler mor by mpcooke3 · · Score: 1

    The difference is not large setting the thing up in the first place but it's a world of difference when it comes to modifying the house functionality later. Sometimes you modify a room or a person or the interface to house, but it's rare that you will ever need to modify and understand how the whole system works, seperate parts can be considered a black box. Whereas, any changes or new queries required in SQL will require re-understanding the relationships between all those tables.

    SQL fitted better with procedural languages where you weren't losing much anyway as all the code was horribly inter-related and refactoring was a nightmare, these days refactoring OO code particularly with unit tests in place can be relatively easy - unless there is an OO-SQL-DB layer that needs to be kept up-to-date.

    Using stored procedures may have performance advantages but it also breaks the OO encapsulation/cohesion even more so than you've already done introducing the relational database in the first place. Taking stored procedures and relational databases to the extreme and you have most business logic in complex queries that only a few people understand and you have lost most of the benefit of OO.

    Good object databases / object caching solutions that are ACID compliant are rare and often have migration/scalability issues, but one day i hope they will replace the relational database altogethor. Or perhaps it will work the other way round and databases like postgres or Oracle will enter from the J2EE side to better support objects.

    Matt.

  111. Re:Hibernate is good, but I am using Prevayler mor by rjshields · · Score: 1

    When you have to quickly write apps with 20 or more database tables, writing SQL code to create/update/retreive/delete/list each and every one of them is a real PITA, not to mention error prone. That's 100 (count them) queries or stored procs for your 20 tables. Tools like Hibernate can be a real godsend in this situation.

    --
    In this world nothing is certain but death, taxes and flawed car analogies.
  112. Re:Hibernate is good, but I am using Prevayler mor by Anonymous Coward · · Score: 0

    So can sybase power designer, SQL detective, PL/SQL developer, and god knows how many other db-aware ides out there.

    Tools are not talent.

  113. Re:Hibernate is good, but I am using Prevayler mor by Anonymous Coward · · Score: 0

    I still prefer directly writing the SQL code myself. It doesn't take that long, and for many things it seems to be more efficient. I only pull the fields that I need.

    And what happens when you go from your mysql SQL to MS SQL to Oracle SQL? They're just different enough to cause a lot of headaches. How do you get the ID if a newly entered row?

    Have you had to go back and maintain your code? Or given it to someone else to maintain? How easy is it for them to add functionality to it, without going through the dozen places where you have the same SQL statement?

    The problem I have with SQL is that its forcing me to twist my mind around to fit into a relational model. My mind's got too many things to worry about, let the computer figure it all out.

  114. Jboss is only mentioned once by Anonymous Coward · · Score: 0

    Jboss ! Humm, well, why not ? They are sponsors of the Hibernate project, after all.

    JBoss is mentioned once in the book and that's almost in passing. I was surprised as JBoss is now funding Hibernate.

  115. Re:Hibernate is good, but I am using Prevayler mor by tanguyr · · Score: 1

    Well, I've seen "modern" applications that were a nightmare to modify (chasing changes thru different levels of abstraction) and SQL (read two tier database backed - "classical") apps which were a snap to maintain (add a field to the database, modify the insert and update procs in a package named after the table, done in five minutes). The key factors in whether an application will age well are the quality of the design and devlopment that went in to it, not the technology that it is based on or uses (within reason, of course... but both hibernate and "classic SQL based" are well within that reason). This whole fashion for endless discussions about why a given technology is "better" than another or why using certain techniques will invariably doom your software project to the ninth and deepest circle of hell are a waste of time in an industry that already "enjoys" a spectaculat project failure rate. Good developers and designers produce good applications, bad developers and designers produce a mess. End of.

    --
    #!/usr/bin/english
  116. Re:Hibernate is good, but I am using Prevayler mor by mpcooke3 · · Score: 1

    Whilst it's obviously true that good developers produce better applications I think that development methodology/tools and team style makes a massive difference.

    Having worked in the same agile team for several years it's a world of difference using modern development tools like eclipse, focusing on OO design, automated unit testing, automated deployment and functional testing. The guarantee that the baseline never contains compile time errors, tests always pass in HEAD and there is automated functional testing togethor means development and refactoring can be done in chunks of a few hours and that the commercial team can see the changes live within a couple of days. In the other company i worked for it took two days just to get hold of the main database person and discuss the required schema changes and then discover breakages in code other people looked after.

    Of course if your project is using release cycles in months then you can hide up the cost of maintaining a relational database. But in commercial terms it's increasingly hard to be competitive if you are working with release cycles of months or years - atleast for a lot industries.

    Having said that a lot can be done to automate schema migration, database recreation and functional testing - but's even with this it still feels like you are fighting the system to get a good development system in place rather than the database helping. It feels more like a required hinderance than an aid to development.

    I'm sure other peoples experiences differ.

    Matt.

  117. Re:Hibernate is good, but I am using Prevayler mor by rjshields · · Score: 1

    Who said anything about talent? I'm talking about getting the job in most efficient way. You don't have to be a ignorant of SQL to use hibernate.

    --
    In this world nothing is certain but death, taxes and flawed car analogies.
  118. moo by Anonymous Coward · · Score: 0


    document.write("Hello World!")