• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDO, Hibernate, Castor

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm new to O/R Mappers. I would like to know more about JDO, Hibernate, Castor. Which is the best option? What are the advantages and disadvantages of each of these. How each of these differ from each other? What are the other alternatives?

Thanks.
 
Ranch Hand
Posts: 1902
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, I have little experience with JDO or Castor (read: none), though I've recently started using Hibernate after reading O'Reilly's Hibernate: A Developer's Notebook. I've found it fairly easy to use and quick to get going with.

There is a bit of a learning curve to switching over, and you kind of have to get used to the XML syntax needed to generate the mappings and Java, but beyond that, I've had few problems or complaints. (I suspect switching to any ORM tool requires a learning curve.) But as I said, it's been fairly flexible in all the ways I've needed it to be thus far, and it's fairly quick to use once you get used to it.
[ August 16, 2004: Message edited by: Theodore Casser ]
 
Anitha Lingam
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Theodore,

Thanks for your reply.
There are high chances of using JDO in our project. So would like to know more about JDO.
Moreover i learnt that JDO is a standard and it is portable while Hibernate is not.
What are the features available in Hibernate that is not available in JDO or vice versa.
Is it that developers started using Hibernate that they do not want to switch to JDO.

Thanks.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Comparison
http://c2.com/cgi-bin/wiki?ObjectRelationalToolComparison
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Old thread
https://coderanch.com/t/214766/ORM/java/Hibernate-vs-JDO
 
Theodore Casser
Ranch Hand
Posts: 1902
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I can't see any reason Hibernate isn't portable, since it's all Java-based. (There's nothing OS-specific in it.) But unfortunately, I don't know much about JDO, so I can't help you there, really.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me just add to the original question. All three are quite similar.
  • JDO is an object persistence standard - note that I did not say "O/R mapping standard". JDO is also geared towards persistence into object databases.
  • Hibernate is possibly the most popular Java O/R mapper. It is not JDO compatible, but arguably easier to use and more powerful than many JDO implementations.
  • Castor, in my experience, is a nearly-static product. Two years ago they were way ahead of the pack, but they've hardly moved since. I would not recommend it.
  • Originally posted by anitha lingam:
    Moreover i learnt that JDO is a standard and it is portable while Hibernate is not.

    True. It is up to you (or your managers) to judge how important that is. Avoid knee-jerk choices, though: JDO object-relational mapping is not standardised, just the programming model, so your JDO applications are more locked-in than you might think. Hibernate has a momentum that isn't that much smaller than that of JDO, and it is in more powerful and flexible in a number of ways. Not coincidentaly, the tool has made a definite impact on the of JDO 2.0 and EJB 3 standards-in-progress.

    What are the features available in Hibernate that is not available in JDO or vice versa.

    JDO is standard, and supports object databases. Hibernate is more mature, has a query language (HQL) which is more powerful and quite intuitive if you know SQL, does not require bytecode processing, and allows you to disconnect an object graph, update it in another tier and later reconnect it to persist the update.

    Is it that developers started using Hibernate that they do not want to switch to JDO.

    They believe that JDO represents an inferior product, and I don't think Gavin King was very impressed with the way the JDO 2 expert group is going.

    - Peter
     
    Anitha Lingam
    Ranch Hand
    Posts: 38
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks for all the replies.

    Basically I have the following requirements in my application.
    1. Object persistence
    2. Performance
    3. Database Independence

    Can I know how Hibernate/JDO caters to each of these requirements?

    Thanks.
     
    Pradeep bhatt
    Ranch Hand
    Posts: 8945
    Firefox Browser Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I dont know about performance (Hibernate guys say that it is scalable Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java. There are many implementations of JDO so performance could vary ) but other two requirements should be met by both Hibernate and JDO.

    The Hibernate idea will also be used in EJB 3.0.
     
    Anitha Lingam
    Ranch Hand
    Posts: 38
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Regarding the portability with datasources, my application requires data to be written from the database to flat files and vice versa. Can this be acheived by both Hibernate and JDO?
     
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi

    You can have JDO implementations for various data sources.
    That said, a product like LiDO already supports RDBMS, ODBMS, XML and it own light Java storage based on files.

    Best Regards, Eric.
     
    Pradeep bhatt
    Ranch Hand
    Posts: 8945
    Firefox Browser Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by anitha lingam:
    Regarding the portability with datasources, my application requires data to be written from the database to flat files and vice versa. Can this be acheived by both Hibernate and JDO?



    Flat files? Hibernate doesn't work with flat files.
     
    Ranch Hand
    Posts: 995
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Peter den Haan:
    [...] All three are quite similar.[...]



    ... in intention (to be read persistence), while the target is quite different. While JDO spec aims to offer the generic solution for persistence (to any possible storage - I think this requires lots of guts), while ORMs target only to solve the so-called object-relational paradigm mismatch.

    /pope
     
    author
    Posts: 45
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You can easily persist things to a file, e.g. use HSQL DB, which uses a single text file to hold the database. In Hibernate, you could have two SessionFactories (one for your normal RDBMS and one for HSQL DB) and then load and persist object graphs between them.

    XML is just the same as flat files, after all, its just a text file format. There is no real reason why it should be used for data storage and data management.
     
    Pradeep bhatt
    Ranch Hand
    Posts: 8945
    Firefox Browser Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    http://www.versant.com/index.php?module=vregister&eventid=13&src=SBGG094
     
    Christian Bauer
    author
    Posts: 45
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    It's a sales-seminar. I wouldn't want to attend that
     
    Pradeep bhatt
    Ranch Hand
    Posts: 8945
    Firefox Browser Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Christian Bauer:
    It's a sales-seminar. I wouldn't want to attend that



    Looks like they want to promote JDO.
     
    Ranch Hand
    Posts: 33
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Anitha,

    There's a lot of interest in Java and object-database connectivity at the moment.

    (sentence removed by Mark Spritzler)

    * JDO data transfer is compiled, = fast.
    * True OO query; no more SELECT... FROM WHERE pseudo sql.
    * 100% reliable & more flexible identity handling.
    * Java standards portability.
    * etc.

    > There are high chances of using JDO in our project. So would like to know
    > more about JDO.

    Well, it's certain that JDO would be good, if you've got budget for your project. Commercial impls are robust & powerful these days.

    (Sentence removed by Mark Spritzler

    Effectiveness of development is really what you get, with JDO or o/r technology. It's just so much simpler & easier developing apps... I think you'll like it.

    > Is it that developers started using Hibernate that they do not want to
    > switch to JDO.

    (Sentence removed by Mark Spritzler)

    (Last paragraph remove by Mark Spritzler)

    Cheers,
    Thomas Whitmore
    www.powermapjdo.com
    [ September 11, 2004: Message edited by: Mark Spritzler ]
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic