Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Hibernate in Action

timothy posted more than 9 years ago | from the go-to-sleep dept.

Books 220

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.

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.

cancel ×

220 comments

Sorry! There are no comments related to the filter you selected.

first post! (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10495242)

first post!

Re:first post! (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10495304)

Wow. My first troll rating! Almost brings a tear to my eye...

Hibernate? (2, Funny)

Chuck Bucket (142633) | more than 9 years ago | (#10495264)

well, I overslept Sunday morning, does that count?

CBV*()$#

iPod pyramid schemes (0)

Anonymous Coward | more than 9 years ago | (#10495316)

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

Re:iPod pyramid schemes (-1, Offtopic)

Chuck Bucket (142633) | more than 9 years ago | (#10495365)

So then don't click them. Want a free ipod? so do I! [67.64.95.209]

Regards
CV7398B

Re:Hibernate? (2, Funny)

Timesprout (579035) | more than 9 years ago | (#10495335)

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

Re:Hibernate? (0)

Anonymous Coward | more than 9 years ago | (#10495607)

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

Re:Hibernate? (1)

Chuck Bucket (142633) | more than 9 years ago | (#10495652)

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

CV@#$B

Sad news: Christopher Reeve dead at 52 (0, Offtopic)

Offtopica (413375) | more than 9 years ago | (#10495278)

I just heard some sad news on talk radio - Superman star Christopher Reeve was found dead in his New York home yesterday. Other than heart failure from bead sores, there weren't any more details yet. I'm sure we'll all miss him, even if you weren't a fan of his work, there's no denying his contribution to popular culture. Truly an American icon.

What is Hibernate ? (5, Insightful)

a3217055 (768293) | more than 9 years ago | (#10495285)

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

Re:What is Hibernate ? (5, Funny)

Dan East (318230) | more than 9 years ago | (#10495343)

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

Dan East

Re:What is Hibernate ? (1)

elmegil (12001) | more than 9 years ago | (#10495809)

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

Re:What is Hibernate ? (5, Informative)

Jouser (243992) | more than 9 years ago | (#10495347)

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.

Re:What is Hibernate ? (2, Insightful)

FosterKanig (645454) | more than 9 years ago | (#10495358)

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

Re:What is Hibernate ? (1)

grm_wnr (781219) | more than 9 years ago | (#10495360)

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

Re:What is Hibernate ? (5, Informative)

jonathanduty (541508) | more than 9 years ago | (#10495366)

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).

Re:What is Hibernate ? (4, Informative)

Tailhook (98486) | more than 9 years ago | (#10495681)

(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.

Re:What is Persistance ? (0)

Anonymous Coward | more than 9 years ago | (#10495694)

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.

Re:What is Hibernate ? (1)

lpangelrob2 (721920) | more than 9 years ago | (#10495775)

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.

Re:What is Hibernate ? (3, Informative)

grunt107 (739510) | more than 9 years ago | (#10495376)

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.

Re:What is Hibernate ? (0)

Chuck Bucket (142633) | more than 9 years ago | (#10495394)

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

LCB*$#@

Re:What is Hibernate ? (0)

someonehasmyname (465543) | more than 9 years ago | (#10495385)

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?

The overview tells us nothing (4, Insightful)

frovingslosh (582462) | more than 9 years ago | (#10495721)

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!!!

Anal (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10495286)

Anal Rape. Discuss.

Re:Anal (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10495446)

I don't understand what's so great about anal rape.

Vaginal rape is where it's at.

A 400 page manual? (5, Funny)

Weaselmancer (533834) | more than 9 years ago | (#10495299)

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

Slashdotted (1)

SkippyTPE (318952) | more than 9 years ago | (#10495356)

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

Re:A 400 page manual? (1)

Kjuib (584451) | more than 9 years ago | (#10495581)

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.

What the hell is Hibernate? (1, Insightful)

Anonymous Coward | more than 9 years ago | (#10495300)

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

Re:What the hell is Hibernate? (0)

Anonymous Coward | more than 9 years ago | (#10495471)

Amen!

So what is it? (1, Redundant)

bamf (212) | more than 9 years ago | (#10495301)

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

Re:So what is it? (2, Informative)

DA_MAN_DA_MYTH (182037) | more than 9 years ago | (#10495472)

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 [springframework.org] you can write a lot of robust reusuable objects, if you utilize java's OO design methods.

*BEHEADING is dying (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10495310)

It is now official. Headcraft confirms: *BEHEADING is dying

One more crippling bombshell hit the already beleaguered *BEHEADING community when Headcraft confirmed that the total number of executions by *BEHEADING dropped yet again, now down to less than a fraction of 1 percent of all executions worldwide. Coming on the heels of a recent Headcraft survey which plainly states that *BEHEADING has dropped dramatically after the US invasion of Iraq, this news serves to reinforce what we've known all along. *BEHEADING is collapsing in complete disarray, as fittingly exemplified by failing dead last in the recent Ruthless Dictators comprehensive execution test.

You don't need to be a Jailed Dictator [floogie.org] [floogie.org] to predict *BEHEADING's future. The hand writing is on the wall: *BEHEADING faces a bleak future. In fact there won't be any future at all for *BEHEADING because *BEHEADING is dying. Things are looking very bad for *BEHEADING. As many of us are already aware, *BEHEADING continues to lose market share. Rivers of blood of blood of blood no longer flow from headless corpses..

Ruthless dictator *BEHEADING is the most endangered of them all, having lost 93% of its core dictators. The sudden and unpleasant deaths of long time *BEHEADING evangelists Uday and Qusay Hussein only serve to underscore the point more clearly. There can no longer be any doubt: *BEHEADING is dying.

Let's keep to the facts and look at the numbers.

*BEHEADING leader Qusay stated that 500,000 Iraqis 'dissappeard' during Saddam's regime. How many of them died by *BEHEADING? Let's see. Executions were generally carried out by hanging, bullet to the head, or *BEHEADING. With *BEHEADING being to most difficult to clean up after, let's conservatively estimate that only 5% of the Iraqis that 'disappeared' were *BEHEADED, so 500,000 / 20 = 25,000 deaths by *BEHEADING during Saddam's regime. Saddam took power in 1979, meaning his regime lasted 24 years. Therefore there were (25,000 / 24) ~ 1041 *BEHEADINGS PER YEAR during Saddam's regime. This is consistent with human rights reports. Since the US invasion, there have been approximately 50 *BEHEADINGS. Therefore there have been (50 / 1.5) ~ 33 *BEHEADINGS PER YEAR after the US invasion. Clearly, the terrorists are not as efficient at *BEHEADING. *BEHEADINGS have dropped 97% in the past 18 months. *Clearly BEHEADING is dying.

Due to the troubles of Saddam's Regime, what with it being gone and everything, massive amounts of *BEHEADING stopped and was taken over by a dismal few but high profile *BEHEADINGs that were carried out by nothing but cowardly terrorists Now *BEHEADING is also dead, its corpse turned over to yet another charnel house.

All major surveys show that *BEHEADING has rapidly declined in market share. *BEHEADING is very sick and its long term survival prospects are very dim. If *BEHEADING is to survive at all it will be among terrorist networks. *BEHEADING continues to decay. Nothing short of a miracle could save it at this point in time. For all practical purposes, *BEHEADING is dying.

Fact: *BEHEADING is dead.

© 2004 CmdrTaco (troll)

Hibernate is good, but I am using Prevayler more (4, Informative)

MarkWatson (189759) | more than 9 years ago | (#10495315)

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 [prevayler.org] 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.

Re:Hibernate is good, but I am using Prevayler mor (1)

110010001000 (697113) | more than 9 years ago | (#10495382)

So which is better? And don't say: "well they have different uses" because YOU are the astroturfer who brought up Prevayler in an article about Hibernate.

I prefer Hibernate. It has fast persistence, great documentation, is truly free, and great support too!

Re:Hibernate is good, but I am using Prevayler mor (5, Insightful)

pcraven (191172) | more than 9 years ago | (#10495436)

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.

Re:Hibernate is good, but I am using Prevayler mor (3, Insightful)

tanguyr (468371) | more than 9 years ago | (#10495575)

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

Re:Hibernate is good, but I am using Prevayler mor (1)

rycamor (194164) | more than 9 years ago | (#10495731)

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.

Re:Hibernate is good, but I am using Prevayler mor (3, Informative)

MarkWatson (189759) | more than 9 years ago | (#10495597)

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.

Re:Hibernate is good, but I am using Prevayler mor (1)

nvrrobx (71970) | more than 9 years ago | (#10495645)

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.

Re:Hibernate is good, but I am using Prevayler mor (1)

Greyfox (87712) | more than 9 years ago | (#10495680)

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.)

Re:Hibernate is good, but I am using Prevayler mor (2, Informative)

rycamor (194164) | more than 9 years ago | (#10495806)

Notice this quote [javaperfor...tuning.com] 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.

Re:Hibernate is good, but I am using Prevayler mor (4, Funny)

smcdow (114828) | more than 9 years ago | (#10495569)

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?

Re:Hibernate is good, but I am using Prevayler mor (1)

smileyy (11535) | more than 9 years ago | (#10495711)

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

Re:Hibernate is good, but I am using Prevayler mor (1)

William Tanksley (1752) | more than 9 years ago | (#10495837)

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

What is it? (2, Insightful)

DaHat (247651) | more than 9 years ago | (#10495320)

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.

Re:What is it? (1)

dAzED1 (33635) | more than 9 years ago | (#10495482)

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

By the way, if you've never heard of Hibernate... (4, Informative)

Palshife (60519) | more than 9 years ago | (#10495326)

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.

MOD PARENT DOWN TROLL (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10495368)

MOD PARENT DOWN TROLL

Re:By the way, if you've never heard of Hibernate. (1)

happyfrogcow (708359) | more than 9 years ago | (#10495467)

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.

Re:By the way, if you've never heard of Hibernate. (1, Funny)

Anonymous Coward | more than 9 years ago | (#10495595)

For the comments.

Re:By the way, if you've never heard of Hibernate. (1)

Otter (3800) | more than 9 years ago | (#10495496)

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.)

book better than review, I hope (4, Insightful)

Russ Nelson (33911) | more than 9 years ago | (#10495332)

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

the article (-1, Redundant)

rsheridan6 (600425) | more than 9 years ago | (#10495334)

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

Re:the article (2, Funny)

Anonymous Coward | more than 9 years ago | (#10495412)

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.

whaa? (2, Funny)

josh crawley (537561) | more than 9 years ago | (#10495336)

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...

Re:whaa? (0)

Anonymous Coward | more than 9 years ago | (#10495538)

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

150 words in the summary. (0)

Anonymous Coward | more than 9 years ago | (#10495342)

Yet no mention of what Hibernate actually is. Great.

Why hibernate? What's hibernate? (3, Funny)

Hatta (162192) | more than 9 years ago | (#10495344)

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?

Re:Why hibernate? What's hibernate? (1)

jd (1658) | more than 9 years ago | (#10495857)

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

Pardon my ignorance... (2, Funny)

Saint Aardvark (159009) | more than 9 years ago | (#10495352)

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.

Link? What's a link? (0)

Anonymous Coward | more than 9 years ago | (#10495631)

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.

No, I'm not new here... (1, Flamebait)

cephyn (461066) | more than 9 years ago | (#10495375)

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"

Curious why there's not more. (2, Insightful)

Amiga Lover (708890) | more than 9 years ago | (#10495379)

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?

Re:Curious why there's not more. (0)

Anonymous Coward | more than 9 years ago | (#10495406)

> 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.

Re:Curious why there's not more. (1, Insightful)

Anonymous Coward | more than 9 years ago | (#10495529)

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.

Re:Curious why there's not more. (1)

SnapShot (171582) | more than 9 years ago | (#10495823)

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.

Re:Curious why there's not more. (0)

Anonymous Coward | more than 9 years ago | (#10495536)

> 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.

the homepage is hibernating (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10495388)

Now you know!

In Russia, we hibernate you.

WhatMeWorry

Whoa.. (1)

jx100 (453615) | more than 9 years ago | (#10495403)

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

Huh (0)

Anonymous Coward | more than 9 years ago | (#10495404)

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

I'm hibernating now (zzzzzzzzzzz)

Hibernate? (0)

Anonymous Coward | more than 9 years ago | (#10495414)

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?)

What's in a name? (2, Funny)

maztuhblastah (745586) | more than 9 years ago | (#10495439)

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...

Cheaper here (1)

cloudkj (685320) | more than 9 years ago | (#10495458)

It's cheaper over here [amazon.com] .

Re:Cheaper here (0)

Anonymous Coward | more than 9 years ago | (#10495900)

You earn your living on slashdot?

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

Another project with a lot of Documentation (3, Funny)

Necroman (61604) | more than 9 years ago | (#10495470)

"The R Project for Statistical Computing"

http://www.r-project.org/ [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".

MOD PARENT DOWN TROLL (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10495610)

And don't browse that sight at work, it is disgusting.

Re:Another project with a lot of Documentation (1)

Wills (242929) | more than 9 years ago | (#10495660)

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

Hibernate Inaction (1)

Sensible Clod (771142) | more than 9 years ago | (#10495474)

...

*ducks*

Hibernate? (1)

GodfatherofSoul (174979) | more than 9 years ago | (#10495486)

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.

Re:Hibernate? (2, Informative)

easter1916 (452058) | more than 9 years ago | (#10495559)

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/ [hibernate.org] for more information.

Is there a doc in the house? (3, Insightful)

Doc Ruby (173196) | more than 9 years ago | (#10495509)

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.

I am a tad surprised (2, Interesting)

Timesprout (579035) | more than 9 years ago | (#10495519)

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.

Re:I am a tad surprised (1)

J Mack Daddy (774273) | more than 9 years ago | (#10495691)

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.

Re:I am a tad surprised (2, Informative)

rudedog (7339) | more than 9 years ago | (#10495858)

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?

Re:I am a tad surprised (1)

The Pim (140414) | more than 9 years ago | (#10495902)

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.

Hibernate in action (0)

Anonymous Coward | more than 9 years ago | (#10495520)

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.

Another example of good documentation is R (1, Redundant)

RealAlaskan (576404) | more than 9 years ago | (#10495543)

The R programming language [r-project.org] has excellent documentation [r-project.org] , all written by the developers and users, including a newsletter [r-project.org] and some contributed documentation [r-project.org] , including a little reference card [geocities.com] I wrote.

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

Fresh extend your penis product! (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10495588)

Timothy Zubmv impertinentlyaindd@mymailstation.com
A recent survey shows that 52 % of girls are unsated
with their intimate colleague. certainly most of these girls
would never recite their associate that they are unfortunate.

Put in good the problem [medsforyou.info]

Best thing since sliced bread (5, Informative)

teutonic_leech (596265) | more than 9 years ago | (#10495598)

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 [raibledesigns.com] , 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? :-)

Sufficient docs rare? (3, Insightful)

ajs (35943) | more than 9 years ago | (#10495605)

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.

What their server is doing right now.... (4, Funny)

Matrix_X (145593) | more than 9 years ago | (#10495656)

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

Still too heavy (0, Offtopic)

Anonymous Coward | more than 9 years ago | (#10495674)

Hibernate is still too heavy. If writing a bunch of config files isn't for you, consider Rails [rubyonrails.org] .

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

They got Osama! (0)

Anonymous Coward | more than 9 years ago | (#10495707)

Hibernate in Action (2, Funny)

Hard_Code (49548) | more than 9 years ago | (#10495756)

Summary: zzzzzzzz

Class::DBI (0)

Anonymous Coward | more than 9 years ago | (#10495780)

Hibernate is as bloated and dumb as Java itself.

Perl's Class::DBI [class-dbi.com] is much sweeter!

So, I'm the only one, huh? (2, Insightful)

tokachu(k) (780007) | more than 9 years ago | (#10495792)

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 [hibernate.org] : you should be ashamed.

Where is that Murphies law article (1)

barcodez (580516) | more than 9 years ago | (#10495796)

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.

Hibernate's either been slashdotted... (1)

jd (1658) | more than 9 years ago | (#10495825)

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

Hibernate (1, Informative)

Anonymous Coward | more than 9 years ago | (#10495892)

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

Need an Account?

Forgot your password?