Article: Working with Hibernate in Eclipse

Discussions

News: Article: Working with Hibernate in Eclipse

  1. Article: Working with Hibernate in Eclipse (14 messages)

    Eclipse and Hibernate are poster children for Open Source. Many developers want to integrate the two of them, and James Elliott has written on this topic. James discusses the myriad of Eclipse plugins available for Hibernate, how to set them up, and how they work.

    Introduction
    I recently started using Eclipse as my development environment, in part because of its support for the many platforms on which I develop, and in part because Eclipse is a great example of the power of an open, extensible environment in which people all around the world can contribute. I'm beginning to investigate the extensions people have come up with. For example, I use a little plugin called XMLBuddy to work with XML files, and it's very helpful. So I became curious about whether anyone had written plugins to work with Hibernate, since I've done so much of that recently in putting together the Developer's Notebook. It turns out there are several such efforts underway; in this article we will explore one of them -- the Hibernate Synchronizer.
    Read about Working with Hibernate in Eclipse

    Threaded Messages (14)

  2. That article reminds me ‘Something for Dummies' books and mouseclicking – wizard-like approach to ORM will most likely produce some dummy results.
    I would strongly suggest not using mouseclicking plugins, rather some syntax checkers and helpers.
    The best approach IMO is to use IDE agnostic XDoclet to generate hbm files and keep project IDE agnostic and fully buildable from CLI.
  3. +1 to using XDoclet for Hibernate development

    It just seems backwards to take a mapping-centric approach to class design. The object is designed to fit the business needs, and the ORM layer should exist to transform the data from the DB structure into those objects. Though imperfect, it seems more natural to design the class the way you want it, then attach metadata to the attributes you want to map to the database.
  4. +1 to using XDoclet for Hibernate developmentIt just seems backwards to take a mapping-centric approach to class design. The object is designed to fit the business needs, and the ORM layer should exist to transform the data from the DB structure into those objects.
    +1 for using things that make sense in given circumstances :-)

    While it is definitely nice to be able to dictate a DB schema based on your application object model, often (if not always) it is the database that is the integration point in a big enterprise, and yours is just one of the applications accessing it.

    Having control over mapping "glue" between DB and object layers gives maximum flexibility. If you don't need such flexibility, fine. But very often you do, so the attempts to create new "metadata religion" are overly simplistic and can't be taken seriously. It is not the size that fits all. You maybe lucky to design both db and object model yourself, but you can't count on that in most cases.

    Therefore having working tools that help you to "connect" the two worlds is invaluable. People saying "who needs GUI, we have [XDoclet|metadata]" are either trolling or live in a dreamworld.
  5. dreamworld[ Go to top ]

    People saying "who needs GUI, we have [XDoclet|metadata]" are either trolling or live in a dreamworld.
    Actually, I say "who needs GUI, we have JSR-175" :-)

    I'm not trolling, so I guess I must be living in a dreamworld.

    Really, UML tools like Rational Rose have /completely failed/, in practice, to realize the dream of writing code in graphical terms. Why should metadata be any different to other kinds of code? Text is simply the most concise, most accurate way to communicate most things in computing. You just have to find the right language.

    (XDoclet was a great experiment that pointed the way.)
  6. dreamworld[ Go to top ]

    I'm not trolling, so I guess I must be living in a dreamworld.
    I am working on it, hope to get there soon too ;-)
    Really, UML tools like Rational Rose have /completely failed/, in practice, to realize the dream of writing code in graphical terms.
    Agree 100%! In the past I warned some customers against taking the whole Rational process thing too seriously. After paying all the ridiculous license fees, the tools ended up being used as a glorified text editor for Use Cases and replaced by Word at some point :-) But how is this fact connected to the ORM tools?

    As a consultant I'd say I've done at least a dozen large and medium scale ORM projects and countless prototypes (starting around '98 when ORM was still a curse word in Java). I used Cayenne, EOF and TOPLink extensively, and I am having hard time imagining why a GUI tool can be a hinderance. Unlike Rational Rose, where you have to spend a few months reading UML books just to understand what the buttons mean, ORM tools are intuitive and easy (ok, TOPLink modeling tool was the worst, this leaves two good ones - EOModeler and CayenneModeler)... Try one someday :-)

    My point is not to convert anyone or to start a religious war (which seems to be going on already), but rather to give a more pragmatic perspective. This is not even the opposing view, as I have nothing against code metadata. Just want to make sure that people reading these posts don't buy into a simplistic and unsubstantiated denial of ORM modeling tools and know what their choices are.

    Cheers,
    Andrus
  7. RE: Dreamworld[ Go to top ]

    Sure text is the most accurate way to communicate most things in computing, but it's certainly not the fastest. Having a "good" gui can rapidly speed up the game. IDEA is a great example of how a GUI gets it done. I remember the last time I hear this comment was from a guy who wanted to stay out of the PM on OS/2. Kinda silly really.

    The rule I follow is: I should NEVER have to touch an XML doc by hand. Of course in practice, I do daily though. XML was never designed to be edited by hand as it's extremely verbose. It makes a nice interface between a core library and an external tool, like a GUI. See the struts/tiles builder tools. See the EJB builder tools. See the ANT generators. And so on.

    GUIs are the fastest way to get bulk work done. XDoclet is a royal pain in the ass considering you now have 2 topics to chew through: Hibernate and the xdoclet markup for it. Because of xdoclet, we now have the new coined term of Attribute Oriented Programmer. They have started a whole new methodology. Also the thing is ANT driven... not all of us use freak'in ANT all the time.

    As for JSR-175, here's a snippet, "The exact syntax will need to be determined by the expert group. There appear to be a number of possibilities, including (but not limited to!) using a doc comment tag @meta or adding a new Java programming language keyword meta." Hmmm, so instead of using something "normal" like the .NET metadata structure, we're going to overload javadoc *AGAIN* with @meta tags? I can't say if this is the final decision since I haven't gotten into that far into the spec, but I hope not. That's just lame... talk about lack of separation of concerns.
  8. RE: Dreamworld[ Go to top ]

    XML was entirely designed to be edited by hand!
    Thats the entire point. Human and computer readable.
    Discard this and you are simply left with a crap ascii hierarchical format.

    Jonathan
  9. Great Hibernate Tool[ Go to top ]

    I work for a company that has developed a eclipse hibernate tool - MyEclipse. Check it out with a free trial if you're interested. Zero obligation.
  10. Problem Installing[ Go to top ]

    I am having problem installing this plugin on Eclipse 3.0M5. Any thoughts ?
  11. Just go JDO[ Go to top ]

    ... JDOGenie has plugin support for eclipse as well, and at least then you're on a standard.
  12. oh please[ Go to top ]

    ... JDOGenie has plugin support for eclipse as well, and at least then you're on a standard.
    At most you're on a standard.
  13. BTW. We have something for hibernate in Eclipse.
    Exadel ORM Studio Hibernate Edition
  14. I am looking for any hibernate plugin (GPL) that integrates with Elipse.
  15. I am using one of eclipse based tool, called myeclipse.
    this tiil comesd very handy as you can add hibernate capabilities to your project.

    It also provide Spring, tapastry, Struts,JSF and JSTL on the fly.Tool has a database manager, which can be used to connect to your database and add drivers to class path.Using this tool you can genereate your POJO s and hbms.It generate Session factory for the application.

    I would recomend it to any one who want to use eclipse
    for real Projects with No major Issues.

    You can download a trial from http://www.myeclipseide.com/ or get a subscipted version very cheap.You get Eclipse features with above mentioned key features on this tool