Cayenne ORM 1.1 Final Available

Discussions

News: Cayenne ORM 1.1 Final Available

  1. Cayenne ORM 1.1 Final Available (30 messages)

    Cayenne Object Relational Mapping final 1.1 release is available for download from objectstyle.org.

    "One-dot-one" is a result of a 14-months effort by our development team and offers a whole set of new features and enhancements. Just a few highlights out of this long list: SQLTemplate (think iBatis inside an ORM, without XML in queries, editable via GUI), distributed caching, expression parser, inheritance mapping, professionally looking Modeler, etc.

    More reading about Cayenne:

    http://objectstyle.org/cayenne/
    http://theserverside.com/articles/article.tss?l=Cayenne

    Andrus

    Threaded Messages (30)

  2. Great job[ Go to top ]

    Keep up with the good work.
    Excelent product with excelent GUI.
    Bye bye xml mappings.
  3. Keep it going[ Go to top ]

    Powerful mapper.... and Excelent GUI!

    Thanks for the great product.
  4. It looks like the persistable Java classes must be JavaBeans. Is this correct?
  5. It looks like the persistable Java classes must be JavaBeans. Is this correct?

    Strictly speaking - no, as Cayenne doesn't use Java reflection or bean introspection. Though of course in 99.99% of cases your objects will be JavaBeans in a traditional sense. What is expected instead is for all persistent objects to implement DataObject interface. This is commonly done by subclassing CayenneDataObject.

    Andrus
  6. Though of course in 99.99% of cases your objects will be JavaBeans in a traditional sense.
    I hope not.
    What is expected instead is for all persistent objects to implement DataObject interface. This is commonly done by subclassing CayenneDataObject
    So I don't necessarily need a default constructor along with getters and setters?
    BTW, I don't mind implementing an interface for persistence, but subclassing is a little too intrusive for my liking.
  7. Though of course in 99.99% of cases your objects will be JavaBeans in a traditional sense.
    I hope not.

    Here here! ... I actually <em>like</em> encapsulation! :-)
  8. DataObject Design[ Go to top ]

    That's fine - Cayenne does not need set/get methods. DataObject interface (see Cayenne JavaDocs) creates a sort of backdoor to read/write the properties. Arguably this is a lesser violation of encapsulation principles ;-)

    Default constructor is actually needed. You can bypass that by subclassing DataContext and using your own factory if you care. Default implementation tries to avoid too much indirection, but does not prevent you from doing your own thing.

    Same thing for subclassing... Common superclass is used for convenience. DataObject interface (implementing a "contract" with DataContext - something that makes Cayenne so "smooth" compared to many other ORMs) is all that is needed. If framework-provided superclass is unacceptable in your applications, you can use some sort of delegation model to have a single custom DataObject helper shared by all your persistent classes...or do something else.. Really up to you.

    Cheers,
    Andrus
  9. vs. Hibernate[ Go to top ]

    What's the advantage of Cayenne comparing to Hibernate?
  10. vs. Hibernate[ Go to top ]

    Check this link out...
    http://www.theserverside.com/blogs/showblog.tss?id=CayenneAndHibernate

    To all... which one (Hibernate/Cayenne) would you consider be more professionally used in the industry?
  11. vs. Hibernate[ Go to top ]

    To all... which one (Hibernate/Cayenne) would you consider be more professionally used in the industry?

    Is that a trick question? By the way, for real comparison advice, look here and then do it yourself: http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/06/23#comparingpersistence
  12. vs. Hibernate[ Go to top ]

    Is that a trick question? By the way, for real comparison advice, look here and then do it yourself...

    Thanks for the link... & nope just wanted to know which one ppl prefered to use or which one will be developed with more.
  13. vs. Hibernate[ Go to top ]

    Bill's blog mentioned above is a good starting point, though of course it uses a very simple example. My own answer to "Why Cayenne and not Hibernate?" (this is also discussed in my TSS article) is GUI tool and a DataContext abstraction. Hibernate folks like to make a big point about how you don't need a GUI tool, we simly give you a GUI tool ;-) IMO all the talk about annotations saving you from XML is simply red herring.

    As for who has more installations - Hibernate does, this is not a trick question ;-)

    Andrus
  14. vs. Hibernate[ Go to top ]

    The GUI tool with annotations will be the IDE, which is way better, IMO.
  15. vs. Hibernate[ Go to top ]

    If history is repeating itself in the same way like it did for Tapestry 2004 vs. WebObjects 1996, then I'd say Cayenne will gain lots of momentum (since it is the opensource equivalent 2004 vs. EOF 1996)
  16. vs. Hibernate[ Go to top ]

    Cayenne is even older than Hibernate.
  17. Momentum[ Go to top ]

    Then I guess Cayenne is "the best kept secret" ;-)

    Actually I've heard this phrase used to describe WebObjects like a million times. All this happened on the backdrop of Sun trying to repackage EJB to avoid this non-stop embarrassment, people hailing Struts as this ultimately cool way to write web apps... Sigh... talk about momentum in technology.

    BTW, this is in no way directed against Hibernate, which is the right solution for the right problem. I am very glad that it exists the way it is and plays a great role in educating programmers (and Sun) about the right persistence architecture. I am convinced Cayenne provides a better abstraction overall, but this nothing like say Tapestry vs. Struts.
  18. Momentum[ Go to top ]

    It certainly has a different target audience. I only remember 2 or 3 requests for a GUI mapping tool on the Hibernate forums in almost 3 years, not enough to make users learn yet another method of specifying metadata.

    Well, it also seems users have more problems figuring out how object persistence works in general, not really how mapping metadata is defined (that is, how to write XML or how to click a button). Knowing which button to click on and what XML element to use is the trick.

    Luckily everyone is on the right track now with Annotations (which is again not perfect, but what is...) so we can reduce the required metadata significantly. Some good examples in the EJB3 preview from JBoss, if you are interested. Emmanuel Bernard sent an email to the Hibernate dev list today, he is almost ready for a first alpha of Hibernate3 annotations (which implement the EJB3 spec early draft). You can get that stuff from CVS for a test drive. Let's see if we can show that next week at Javapolis.

    Are annotations on the road map for Cayenne as well?
  19. Momentum[ Go to top ]

    Re: annotations in Cayenne

    Same story as with Hibernate and GUI ;-) We don't have a *single* request to support it. Though wouldn't object if someone contributes such code.

    Re: GUI, learning, etc..

    We had this discussion sometime back on this forum. Hope to make it more constructive this time. My experience is that GUI helps learning good OR modeling practices (something as you rightfully pointed out is the biggest problem to new users), and actually avoid bad ones. And also do it gradually, still being able to develop pretty advanced persistent code with Cayenne while you are at it.

    A new user who knows nothing about Cayenne or ORM fires up a Modeler, selects a single menu item ("Reverse-engineer DB"), and instantaneously gets a working mapping *of his own DB*, not some abstract tutorial. Next menu item - "Generate Java Classes", and his data layer is done [I love to show this during Cayenne presentations - "a working persistence layer from an unknown DB in under 2 minutes". And that's as good for the experts - prototyping is a powerful thing]. Now a user can poke around and explore the generated mapping to learn how to map things properly... So he can take a look and see "hey, all my FK were translated to Java class properties pointing to another class", or "hmm, my PK wasn't included as a class property, there might be a good reason for that", or if he is lazy, he can just use it right away ;-)

    Another thing... Annotations is a great shortcut, and if you have (a) an IDE that can hide them and (b) some tool to bootstrap your code to the initial DB schema you'll get by just fine in most cases. But all the mapping still resides in your Java class. Cayenne recognizes the value of "Mapping" in "OR Mapping", so a model or mapping being a separate manageable (that's not UML after all :-)) piece goes a long way. You can tweak and substitute things without recompiling Java code. E.g. a concept of DataDomain in Cayenne allows you to map the same sets of Java classes in any number of a slightly different ways (this was a requirement on an actual project).

    Andrus
  20. Momentum[ Go to top ]

    Reverse engineering in Hibernate its two Ant tasks (one to fire up Middlegen, the other starts CodeGenerator) and a click on "Generate". Max Andersen is working on a GUI wrapper for the whole process.

    Of course the result is pretty much useless and I would expect the same from any other reverse engineering tool. There just isn't enough information in the JDBC metamodel.

    And for not recompiling things: it's really amazing that in every forum (and even in our Hibernate trainings) people immediately ask if they can override annotations (using XML files or whatever) on deployment. Of course you can :) Nobody thought that this was the _only_ interesting thing about annotations though. I'd expect you get more requests about when Hibernate users switch and more people (can) use JDK 1.5. I like the fact that the whole idea was already tested for years with XDoclet, we now know what is needed and where the limitations are.
  21. Momentum[ Go to top ]

    And for not recompiling things: it's really amazing that in every forum (and even in our Hibernate trainings) people immediately ask if they can override annotations ... I'd expect you get more requests about when Hibernate users switch and more people (can) use JDK 1.5.

    Thanks for pointing this out. I guess I need to better educate myself on annotations. My few EJB experiences using XDoclet were very positive, but as I don't use EJB, and I have Cayenne for an ORM, I guess I never bothered to study it deeper.

    As for JDBC not providing enough metadata... Except for those cases when people don't define constratints in the DB (I find it amazing - companies pay all these $$$ for an Oracle license and then don't bother to define FKs), metadata is sufficient to create a reasonable default mapping. I'd say if you are not a perfectionist (and your DB is well designed), you won't have too many things to change...
  22. I congradulate Cayenne development team for their release.
    It is interesting that the GUI feature is the focus rather than the capabilities of the engine. Hibernate has a number of GUI based tools to reverse engineer the database and build a mapping. As pointed out 'Hibernate Synchroniser' and there is Middlegen. Both of these projects are not under the hibernate banner as such so it appears that aspect is not considered as people appear to conclude Hibernate does not have a GUI support. That conclusion is wrong.
    Focusing on Middlegen, it includes a Hibernate plugin which has been build (and maintained) by the hibernate team. It is also currently the recommended tool for reverse Engineering the database. Taking Andrus's quote 'I'd say if you are not a perfectionist (and your DB is well designed), you won't have too many things to change...' applies to Middlegen as well.
    The real difficulty is appling GUI operations that cover the richness of possible mapping capabilities of the engine. In Hibernate's case (Hibernate 3 is even more so) its difficult as the engine is so rich. As mentioned by others the tools are going to be extended and new (GUI based) tools will appear for hibernate and EJB3.
  23. Why GUI[ Go to top ]

    It is interesting that the GUI feature is the focus rather than the capabilities of the engine.

    Cause this is one feature that can be discussed freely without really knowing how the competing technology works ;-)
  24. I just try it today ...[ Go to top ]

    I just try it today :

    More than another ORM framework, it seems to be a good choice for mapping your existing DB schema with POJO. The learning curve is linear : you can get your application working without any new XML DTD to digest (GUI tool provided). I created a simple app with n-n relationships between my objects in three hours ...

    Again, it's a good job !

    Cheers,

    FJ.
  25. Cayenne ORM 1.1 Final Available[ Go to top ]

    That's a fine release. I'm using cayenne since the first 1.1 beta about a half year back. I've done 1 prototype and 2 medium sized projects with cayenne as backend (and struts+velocity). Especially i like the GUI tool, i'm using jbuilder so i'm not used to ant and hand editing xml files, on a normal working day i don't even view a single tag of xml.

    That's why the modeller is ideal, click and type and click on the generate button generates my pojo's and sql schema. No configuration worries, it just works.
  26. Cayenne ORM 1.1 Final Available[ Go to top ]

    About the GUI, Hibernate has HibernateSynchronizer for Eclipse users.
  27. Cayenne ORM 1.1 Final Available[ Go to top ]

    About the GUI, Hibernate has HibernateSynchronizer for Eclipse users.

    Do you mean this HibernateSynchronizer?
    http://www.binamics.com/hibernatesynch/

    Have you seen the web site lately?

    "My wife is pregnant so my priorities have changed. I will, most likely, not get to any feature or bug requests for a little while."

     - Don
  28. EJB ( SLSB) support[ Go to top ]

    Does this version of Cayenne support interoperability with SLSB ? I could switch from Entity beans to Cayenne if and only if I dont have to change my Data facades which as SLSBs.

    I saw some mails on the Cayenne mailing list that talk about this being available in 1.1 .


    Otherwise, Hibernate become my only other option.
  29. EJB ( SLSB) support[ Go to top ]

    Yes, you can surely use Cayenne within session beans. It wasn't possible in 1.0 as Cayenne managed its own transactions. In 1.1 Cayenne can be used with container transactions.
  30. EJB ( SLSB) support[ Go to top ]

    Andrus
    Thanks for the response.

    Here is a URL which which other Cyanne newbies from EJB background might find useful

    http://www.objectstyle.org/cayenne/examples/ejb-facade/
  31. Congrats,

    Just downloaded it and all that I can say is that if I could use it with Spring I would use it on my next project.
    I searched the mailing lists and heard plans for it. Hope it will happen soon.

    Pedro Costa