Slashdot Mirror


Hibernate - A J2EE Developers Guide

Simon P. Chappell writes with a review of the Addison Wesley-published Hibernate - A J2EE Developers Guide. "To quote the project website: 'Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java.' To quote the back cover of the book: 'Now there's a practical, hands-on guide to using Hibernate's flexible, fast object/relational persistence and query services.' Phew! What a lot of spin packed into two sentences. Let's take a look and see if it delivers." Read on for the rest of Chappell's review. Hibernate - A J2EE Developers Guide author Will Iverson pages 351 (13 page index) publisher Addison Wesley rating 7 reviewer Simon P. Chappell ISBN 0321268199 summary Overall a solid work

What's To Like

The first thing that I liked is the way the book is written. Mr. Iverson has a very pleasant writing style that I found engaging. Not too formal and not too light. Naturally, there is a certain amount of Hibernate evangelism, but hey, if the author doesn't like the tool, then how am I supposed to feel good about it either? The evangelism does not feel like it strays from the bounds of truth, and there is much honesty in his first and last chapters where he discusses reasons for using a tool like Hibernate, and how Hibernate has influenced the design of the soon-coming version 3 of the EJB standard from Sun.

Chapters two, three and four cover the basics of using Hibernate. Each covers a different aspect, and each is independent of the other. Chapter two covers the use of the Hibernate mapping file as the reference that everything else is built from. This is the recommended mode of operation, where the database schema and data access objects are built for you. Chapters three and four are for those of us in the corporate world where the code or the database schema comes first and we have to adapt to and accommodate it.

Chapters seven and nine give the database theory-challenged amongst us a useful refresher in database relationships and transactions. The information, while provided in the context of Hibernate, serves as a useful refresher for the rest of us.

Hibernate has three query mechanisms. Given its relational database capabilities, one of the options is the use of plain old SQL, naturally. The two remaining options are the Hibernate Query Language (HQL) and the Criteria API. The HQL gets a fairly decent amount of coverage and left me to infer that it is the preferred means of expressing queries. The Criteria API gets only four and a half pages of explanation, which is still more than the single page dedicated to SQL.

The next to last chapter is a collection of real-world advice and tips for getting the best from Hibernate. This is a very useful chapter and looks like it contains good advice. The only thing I would suggest is that it's a little slim for a chapter of its own. Either the information could have been tucked in an appendix, or it could have been spread through the book in the form of embedded tips.

Naturally, the book has a website to accompany it.

What's To Consider

The book carries a copyright date of 2005 and a first printing date of November 2004. That being said, it should come as no surprise that the version of Hibernate covered is 2.1.2, but at the writing of this review (early April 2005) Hibernate 3 went final. I feel that the majority of the concepts and basic operations will be unchanged, but take this into account when deciding upon a purchase. While it is difficult to write books against the constantly moving target of an open-source or free software project, it is possible. I was involved in the technical review of a number of Struts books and they were challenged with the task of being available as version 1.1 was released. A massive undertaking, but one that they proved doable.

The typesetting seems crowded in this book. I'm not a white-space extremist, but I sure recognise when there's too little. The listings are often multi-page and have a slightly squashed feel to them.

Depending upon your point of view, chapter five is either a very useful annotated explanation of all of the available mappings within Hibernate, or it's a bad case of using available online documentation as filler (53 pages). Personally, I dislike this, but if you're in the market for an "all-in-one" style of book, this might work for you.

Summary

This is a solid work that will take you from novice to a good working knowledge of Hibernate. If you can live with the fact that the book targets Hibernate 2.1.2 while the current production version available from the website is 3.0, then give this book a try.

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

36 of 244 comments (clear)

  1. Chapelle? by blackmonday · · Score: 2, Funny

    I'm programming Java, bitch!

  2. A few things... by FortKnox · · Score: 5, Informative

    Hibernate, first of all, is becoming the de facto persistance layer for all modern java webapps. Tied up with the Spring Framework for transactions and either Struts or Tapestry on the front end, it is becoming a commonplace for tons of Java work.

    This book, however, I found extremely lacking. It didn't really teach me anything new that I didn't already learn from the webpages. Granted, I've been using hibernate for over a year now and have kept up with the technology, so perhaps this is still a book for someone new to the technology.

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    1. Re:A few things... by rossifer · · Score: 2, Insightful

      What I didn't like is the assumption that generating business objects from your mappings works well (or at all, in larger systems). I understand the argument for putting the business rules in the UI layer (Spring's controller objects, Struts actions) and letting the domain objects be simple DAO's, and I don't buy it for anything more complex than PetShop applications.

      If you're writing a toy application or a simple database report generator, sure. You don't need complex business rules and it's probably easier to let someone generate DAO's and push what limited business rules there are into the UI layer.

      If, however, you're writing a substantial business application, you've got four or five interfaces per deployment (UI, scheduler, import data API, erp interface, etc.). If all of those interfaces don't act against the same business rules enforced upon them, your customer's data is hosed and quickly. Anecdotally, all but one of the "data corruption" bugs in my last big project were from business rules that someone thought should go into the UI layer, and didn't get enforced for other interfaces, allowing usage of those interfaces to wreak havoc.

      The other approach I've seen for generated DAO's is to hang business rule implementations off of the DAO's via inheritance. Not only is this approach contrary to the goal of inheritance, it prevents you from actually having object oriented classes. You'd better not try to have polymorphic behavior in those classes. The kicker with this approach is that your business rule classes are just as complex as if you'd simply written good domain objects in the first place, meaning that the generation has bought you no reduction of effort.

      "The overhead of maintaining separate artifacts." is wildly inflated. The system details are there, whether conflated into the same files or separated into different files. You also have fewer artifacts if you don't separate interface from implementation. You also have fewer artifacts if you combine several classes into the same .java file. Fewer artifacts != lower cost of development/maintenance.

      Regards,
      Ross

  3. Re:Hibernate by rel4x · · Score: 2, Insightful

    Yeah, really, it's not that bad. As a Java programmer, I've come to find out as long as you make sure you don't use more memory than you need (i.e. nulling variables that are no longer useful), things run fine... ...correction. Things run fine so long as you don't use Swing. Swing needs a serious makeover (yes I'm aware of alternatives, but Swing just looks so dang cool when it works)

    --

    Before you mod me funny, think, perhaps I was insightfully funny?
  4. Is it better than Hibernate in Action? by Babar · · Score: 5, Interesting

    I can't believe a review of a book about Hibernate would not compare it to the book everyone recommends, Hibernate in Action. HiA is a great book, written by people who work on the project, including the lead developer. Of course, this review doesn't have much information that couldn't be obtained from skimming through the table of contents on Amazon.

    1. Re:Is it better than Hibernate in Action? by mrtom852 · · Score: 4, Informative

      Hibernate in Action is the best available I think. I flicked through "Hibernate: A J2EE Developer's Guide" in a bookshop and didn't think it would teach me much - however it might be a better book as an introduction to hibernate. (It certainly looked better than "Hibernate: a developer's notebook")

      I did like HiA but it still left me wanting more. A lot of the book spent time talking about common design patterns where I would have liked to see a bit more Hibernate/DB theory.

    2. Re:Is it better than Hibernate in Action? by d95adam · · Score: 2, Informative

      Here are the other Hibernate books I've read (or skimmed):

      Hibernate: A Developer's Notebook
      Hibernate: A J2EE Developer's Guide (Addison Wesley))
      Java Open Source Programming: with XDoclet, JUnit, WebWork, Hibernate

      But they all fall short of Hibernate in Action imho.

  5. Re:Not Interested by That's+Unpossible! · · Score: 3, Funny

    Yours was a powerful, extremely engaging post that I found chock-full of interesting and insightful commentary!!!

    --
    Ironically, the word ironically is often used incorrectly.
  6. Java never got a fair break. by Future+Man+3000 · · Score: 3, Interesting
    People tend to notice its flaws (oh it's so slow!) because it's the first iteration of its technology, but it is still an excellent tool for getting the job done regardless of its platform.

    Is it going to be replaced by C#? Perhaps, but it is possible to fully exploit it today, and with tools like Hibernate it's possible to rapidly deploy applications on a grand scheme. In today's business environment it is often a matter of getting it done fast rather than best, and if it's turning into a problem with performance it is always possible to turn to another language once you have something in place.

    --

    I never vote for anyone. I always vote against.
    -- W.C. Fields

    1. Re:Java never got a fair break. by customiser · · Score: 2, Informative

      The main use of Java today is in large scale enterprise applications, usually meaning J2EE, although the current trend is the use of lighter alternatives, namely JSPs/servlets coupled with frameworks like Spring and Hibernate.

      This development itself proves the big advantage Java has over C#/.Net in the enterprise arena: a far wider array of supporting libraries and frameworks, not to mention a selection of mature application servers. For this reason it will be quite hard for C# to catch up, especially since it does not bring anything remarkably new or unique to the game; it is just too similar to Java for a switch to be justified.

      As to whether "traditional" enterprise systems built in Java are "done fast"... Let's just say that its biggest drawback (always in the enterprise context) according to its opponents is the sheer complexity of developing, configuring and deploying any application of reasonable size. Hence the appeal of frameworks like Hibernate.

    2. Re:Java never got a fair break. by Hard_Code · · Score: 5, Insightful

      Even in the presence of CLR/C#, I think Java will continue to be very strong and popular. Some things are cumbersome and awkward in Java, granted it has its warts, but on the whole it is very "ergonomic". There is a gigantic amount you can do in Java that will be easily understandable and maintainable by other Java developers. Your options are limited, but that's a feature. JDK 1.5 (ne 5.0) did expand the language a bit with generics, and there has been a lot of controversy over that, but on the whole Java remains rather simple, and a massive amount of libraries have been developed for it, many of which are continually folded into the core.

      --

      It's 10 PM. Do you know if you're un-American?
    3. Re:Java never got a fair break. by Lysol · · Score: 2, Interesting

      Is it going to be replaced by C#? Perhaps,...

      Doubtful. I'm sure C# will get quite popular, but neither that nor will Mono have a foothold on the server like Java does anytime soon. Java's tools and microcosm of open and closed projects are being used by quite a bit by companines and organizations doing real, every day work. Granted, Java on the desktop never took off, but the whole C# vs. Java war is just a myth - there's plenty of room for both to exist.

      I'm using Hibernate on my current project and while it's not the be all/end all, it's definitely a better approach (I feel) than EJB entity beans. 99% of my current data layer is Hibernate code/classes and I'm pretty happy with it. Coupled with various plugin caches and you have a fast, reliable data access layer.

      Once you get the nuances of Hibernate, it's quite easy and sometimes even fast to plug in an entity and go. Remember, it's not just wrapper for JDBC/Transactions, etc, but a fairly mature and robust ORM solution. And, its HQL (yes, another QL) allows for fined tuning of any entities that might become a bottleneck.

      For med to big sized projects, I'd recommend it.

    4. Re:Java never got a fair break. by IceFreak2000 · · Score: 2, Informative
      This development itself proves the big advantage Java has over C#/.Net in the enterprise arena: a far wider array of supporting libraries and frameworks, not to mention a selection of mature application servers.

      This is bound to be the case, considering how much longer Java has been around compared to C# - however, bear in mind that a large number of popular frameworks have already been ported to C#/.Net including NHibernate, Spring.NET and Maverick.NET.

      --
      Life is like a sewer; what you get out of it depends on what you put into it...
    5. Re:Java never got a fair break. by Decaff · · Score: 2, Interesting

      Easy things easy. Hard things possible. Java's got one. RoR nails them both. Bloggers seem to be buzzing about it right now, but in time it's going to be absolutely huge.

      Not in it's current form it won't. RoR has some serious design flaws for major projects. One is that the object model is derived directly from the database, so if the database changes even slightly, this can seriously break code. Serious ORMs have mapping configurations that allow the object model to be isolated from such changes. This hard link to the database also prevents easy portability between different database types - a schema change required by porting can again break code.

      Serious ORM systems (such as Hibernate and JDO) have the ability to fine-tune the loading of fields to prevent serious memory and performance problems. Imagine trying to use RoR for large datasets where the tables included large BLOB or VARCHAR fields - this would be a performance nightmare.

      The RoR people don't seem to understand that the configuration files present in large Java ORM applications are there for a good reason - to abstract and fine-tune database access.

      Finally, RoR requires use of vendor-specific SQL. JDO and Hibernate abstract this. Moving a JDO or Hibernate project between, say MySQL and PostgreSQL can be very fast. It could be a major problem with RoR.

      RoR takes a very old-fashioned database-centred vendor-SQL-specific approach.

  7. Re:Not Interested by FortKnox · · Score: 2, Informative

    Actually, this is one technology that kinda lives up to the hype. Its an ORM that performs (in most cases) as fast as hand-written sql statements. I call that powerful and ultra high performance...

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  8. Hibernate and J2EE by cmiles74 · · Score: 2, Interesting

    I am curious to know if this books spend a decent amount of space on actually using Hibernate in the context of a J2EE application (i.e., instead of using CMP)? I currently work with CMP and I am not a huge fan, I am very interested in alternatives and wonder if this book is the place to start looking.

    The title of the book implies that the book does cover this, but the review doesn't actually mention this specifically.

    1. Re:Hibernate and J2EE by chochos · · Score: 4, Interesting

      My quick recipe for that is:

      1. Screw EJB and CMP
      2. Use Spring instead of EJB's (or in conjunction with EJB's)
      3. Use Hibernate for persistence
      4. Configure Hibernate through Spring and use the Hibernate ORM support in Spring to further speed up development and decrease code (both Java AND xml)

  9. Re:Hibernate by BarryNorton · · Score: 3, Funny
    In fact, much of it is just-in-time (JIT) compiled
    Like OMG, someone should tell the computing press QUICKLY....
  10. Hibernate vs. JDO vs. EJB by prakslash · · Score: 2, Interesting

    What is the latest on this battle?

    There are so many soundbites floating around:

    Hibernate is JDOish but does not follow Sun JDO Spec. But.. Gavin King of Hibernate became a member of JD02.0 Expert Group and would make it compatible with JDO 2.0 Spec.

    JBOSS is adopting Hibernate as the underlying persistence mechanism for its Container-Managed Entity Java Beans.

    EJB 3.0 rejected JDO 2.0.

    So.. now I am confused. Who is the winner? Should I buy the book or not? Anyone care to enlighten us?

    1. Re:Hibernate vs. JDO vs. EJB by Anonymous Coward · · Score: 2, Insightful

      portability.

      oracle is not the de-facto enterprise db.

    2. Re:Hibernate vs. JDO vs. EJB by Shayde · · Score: 2, Informative

      My main reason for going with Hibernate is... it's java. It's iwthin the J2EE appserver environment, deployment to it is identical to deploying any other J2EE component. Package it up, drop it in the deployment dir, and you're off and running.

      Shifting persistent objects into anything other than a standard SQL engine means you have to undersgtand and work with 2 different technologies when manipulating your persistence engine.

      Frankly, I'd like to stay with one language, one deployment method, one set of known plusses and minuses.

      Oh, and Hibernate works fine with a zillion SQL servers. Stored procedures only work with the one they're designed for.

      --
      Event Management Solutions : http://www.stonekeep.com/
    3. Re:Hibernate vs. JDO vs. EJB by scrotch · · Score: 3, Funny

      Tell your DB guys that the word from above is that your database vendor will be changing. Be vague enough that they worry...

    4. Re:Hibernate vs. JDO vs. EJB by Decaff · · Score: 3, Informative

      Hibernate is the most recommended solution.

      Depends what for.

      In spite of what you might read, JDO IS widely used, which was why the JDO 2.0 specification was recently approved against a lot of political pressure.

      JDO does not limit you to relational stores. Hibernate does. JDO 2.0 is very close to Hibernate in terms of use and features, but can work with a very wide range of stored. You can get JDO implementations that work with CSV files, Object databases, XML stores etc. You can use exactly the same code and API to access these stores as you use to access relational stored.

      Hibernate is a high-quality product, but JDO gives you choice.

      There are nice free and open source implementations of JDO as well.

    5. Re:Hibernate vs. JDO vs. EJB by anomalous+cohort · · Score: 2, Informative
      portability

      Mod parent up. It's not caching. Databases can cache too. If you're an ISV and you want to sell to companies that don't neccessarily share your views on which DB vendor is the best, then stay away from stored procedures and make your SQL as standards compliant as possible. In which case, an ORM technology makes perfect sense.

    6. Re:Hibernate vs. JDO vs. EJB by koreth · · Score: 3, Interesting
      Hibernate does not really compete with CMP Entity beans, but perhaps sessions beans.

      I disagree -- Hibernate is almost a drop-in replacement for CMP entity beans. It does nothing to address the issues that session beans address (implicit transaction management and transparent load balancing, to name the two big things session beans buy you) and does the important thing CMP entity beans do (O-R mapping and removing the need for an object to have code to load and save itself.)

      Hibernate does not require you to communicate to another server (RMI, Corba etc).

      Neither does EJB, especially as of EJB 2.0. Using local bean interfaces means no RMI overhead -- they're so against you using remote invocations that local bean methods are forbidden from throwing RemoteException!

      Not, mind you, that I'm any big fan of CMP entity beans. Using them was the biggest architectural mistake I made when I was starting out in J2EE development. Lots of development overhead, bad performance, and very little real gain. Hibernate beats CMP entity beans in just about every respect.

    7. Re:Hibernate vs. JDO vs. EJB by bokmann · · Score: 2, Informative

      This is a complex minefield I have been navigating for a couple of years. HEre is my understanding of it:

      1) When we talk about EJB 3.0 in this context, we are really talking about Entity Beans. Entity Beans are currently crap - do not use them. Future versions of the spec are moving in a better direction though (see below). The Session Beans part of EJB 3.0 are very useful IF you need to services provided by the container (but that is outside this conversation).

      2) JDO is a real thing, and it works really well IF you have an object-oriented domain model that you want to persist as transparently as possible. While not part of the J2EE spec, it doesn't have to be - it works inside the container just fine. (Th main reason it is not part of the spec is political - the EJB vendors didn't want to have to write yet another component). IF you have an existing database schema, your mileage may vary with JDO - it is up the the JDO vendor to so support mapping tools to existing schemas. JDO 2.0 is not revolutionary - it just takes the existing stuff a little further. IF you like this approach, I would also suggest you look at an OODBMS like Versant.

      3) Hibernate ROCKS, especially if you are mapping an existing database to a bunch of objects. It does a lot more than that though - you can start from objects and either generate or map to a schema, start with a schema and generate objects, etc. There is a fundamental 'impedance mismatch' between relational and OO, as the first chapter of "Hibernate In Action" outlines better than any explanation I have seen. It isn't a 'standard', but so what? You use standards when you want to choose between different vendors... This is open source, which is another risk-mitigation strategy for the same problem. 'Ant' isn't a standard, yet I doubt you could show me more than a handful of projects that don't use it (or Maven, which uses Ant under the covers).

      In short, there is no one choice. All have their plusses and minuses, and any can be used in a J2EE environment even if they aren't 'part of the spec'. Even JDBC might be a valid choice given a particular project's needs. The choice is going to depend a lot on the application.

      Sun realizes there is confusion, and is trying to address it... unfortunately, the letter they wrote to 'the community' actually added more confusion to the mix.

      The next version of Entity Beans is going to look a LOT like Hibernate, but will use the new JDK 5.0 concept of 'annotations' to help describe the relational mapping. This will ultimately mean Hibernate will be subsumed into JBoss as their Entity Bean implementation (which is why they are a part of JBoss).

      Sun also wants to have a persistence mechanism that is usable outside of a J2EE container. Entity beans in their current form are not it. JDBC can do this, but it is does not facilitate thinking in terms of an 'object model'. JDO is this spec now, as is Hibernate, and hibernate is actually moving to be more EJB-Like. My crystal ball says that Hibernate and JDO will unite under some uber-api umbrella that allows a developer to use it like either api can be used today, and will be a spec that can be used in a J2EE container as well as outside.

  11. Re:Not Interested by espressojim · · Score: 2, Interesting

    High performance? I'm curious, as I'm heavily thinking about shifting from handwritten SQL and the Spring framework to hibernate. I do scientific research, and pull large data sets (.1 - 5M rows) out of a database to operate on.

    Often, without carefully tuning these querries, I'm getting horrible performance. With well tuned querries (and appropriate indexing), performace is acceptable. If hibernate was smart enough to say - build anonymous views then join on them when it was a benefit to performance - then I'd be interested. If hibernate was smart enough to aggregate multiple rows of data down to a single row to map onto my summary data objects, I'd be interested. If I'm simply pushing the problem off to another framework, then I'm not sure if it buys me anything over my current methodology.

    So, how well does hibernate handle the really complex query work?

  12. Re:if..then by Rosco+P.+Coltrane · · Score: 4, Funny

    if (java.performace >= c.performace) I.eat_hat();

    Bleh:

    push ax
    push bx
    push cx

    call test_speed_C

    move di,cs:[ofs_testC_result]
    move ds,cs:[seg_testC_result]
    move al,ds:[di+2]

    call test_speed_asm

    move di,cs:[ofs_testC_result]
    move ds,cs:[seg_testC_result]
    move ah,ds:[di+2]

    cmp al,ah
    jb bwahaha_msg

    pop cx
    pop bx
    pop ax

    Chicks dig asm, but I'll concede it's so-so for rapid prototyping though...

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
  13. Cayenne - You'll like it better. by CtAhBeAbNoAy · · Score: 2, Informative

    If you think Hibernate is good, then try Cayenne and really be blown away.
    I am not affiliated with Cayenne at all - just a VERY satisfied customer.
    http://objectstyle.org/cayenne/

  14. Re:if..then by sfjoe · · Score: 2, Funny


    To follow the usual java method naming conventions, your method should be named performAce(). Also, from a readability standpoint, a method named performXXX() should probably return void. Secondly, any C programmer worth his salt will remove some (but not all) of the vowels from a method name to mark his territory (i.e. c.prfrmce).
    Lastly, would you like fries with that hat?

    --
    It's simple: I demand prosecution for torture.
  15. XDoclet? by coyote-san · · Score: 3, Insightful

    The most important unanswered question: does it discuss XDoclet?

    I know, many people like maintaining configuration files manually. Some people also like nailing their tongue to flaming coals.

    Personally I prefer using a handful of @hibernate and @spring tags. But I haven't found a decent explanation of how to use the tags (e.g., if you use A you must also use B). It can be annoying - I only recently discovered the @hibernate.joined-subclass tag that permits me to use a common base object (for an integrated 'id' space) without creating a "kitchen sink" monster table.

    --
    For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  16. Re:Not Interested by scrotch · · Score: 3, Insightful

    Well, Hibernate isn't an SQL writer. It's for translating between RDBMS and Objects. It's very good at persisting objects and getting objects from a database. It's very good at pulling large graphs of associated objects, which is a pain in the ass to do manually and difficult to do well (for me anyway).

    Although it's possible to do summaries, it's not what it's for primarily. I think you'd be better off polishing up your SQL rather than learn Hibernate if that's what you're doing. Not that it would be any worse than what you're doing now (you could run the same SQL through it), it just seems like you could get bigger improvements from the time you'd spend learning it.

  17. Sqlmaps by Espectr0 · · Score: 4, Informative

    For those of us that want a simpler, faster, easier to use framework and just want to map your own queries to objects, is much better. And for those that like .NET it is available in that platform too.

    Here's an example on how to execute a query called "myquery"

    MyObject myobject = (MyObject)sqlMap.queryForObject("myquery",myintege r);

    And here is the query declaration:

    <select id="myquery" parameterClass="java.lang.Integer" resultClass="mypackage.MyObject>
    select * from mytable where id = #value#
    </select>

    Simple query to object mapping

  18. Isn't an SQL writer? Please clarify. by fireboy1919 · · Score: 3, Informative

    From the Hibernate homepage:
    The Hibernate Query Language, designed as a "minimal" object-oriented extension to SQL, provides an elegant bridge between the object and relational worlds. Hibernate also allows you to express queries using native SQL or Java-based Criteria and Example queries.

    So...I'm guessing you're using the phrase "SQL writer" in some new and unusual way. Does "SQL writer" mean "writes SQL output to standard output"? Do you mean "SQL optimizer?"

    Hibernate can only talk to RDBMSs that use SQL. It writes SQL to them and recieves SQL from them.

    --
    Mod me down and I will become more powerful than you can possibly imagine!
  19. Re:Embedding configuration in the source? Yuck by koreth · · Score: 2, Informative
    My mod points evaporated this morning, so I'll reply instead.

    The parent is exactly on the mark. The forced separation of deployer/developer roles in J2EE has caused me to do lots of useless busywork since I first started using it back in the 1.0 days. I'm a contractor, and have worked in a bunch of J2EE shops since then -- and not one of them has ever made use of the ability to tweak the sorts of configuration parameters you'd typically include in your XDoclet tags. But until XDoclet started catching on, they all had to endure the development overhead of maintaining separate configuration files and source files.

    In addition, the parent is also spot on that using XDoclet doesn't stop you from changing the configuration at runtime! The system still reads the configuration files and they can still be tweaked at deployment time if need be. The only thing XDoclet does is save the developer from having to maintain all those annoying XML files by hand while coding.

    If it still bothers you, just think of it as embedding default configuration information into the source. Most applications, I think it's safe to say, do that in one way or another anyway.

  20. Re:Not Interested by Evil+Grinn · · Score: 2, Insightful

    And HQL? Wow that's a great feature. Having to learn a mini language that looks almost like SQL and does the job of SQL.

    Yeah, but you can't blame Hibernate for that idea. The whole Java world seems to love pseudo-SQL: EJB-QL, JDO-QL, etc.