Discussions

News: Ebean ORM v2.6.0 - JAX-RS Integration, Scala Option and Collections Support


  1. Ebean is an open source (LGPL license) Java Object Relational Mapping tool. It uses JPA Annotations (@entity, @OneToMany ...) for mapping. It provides a simple API for fetching and saving object graphs.

    Ebean ORM v2.6.0 has just been released.

    The interesting bits in this release for those interested are:

    - JAX-RS Integration Module to help build RESTful API's to Entities
    - Scala types supported
    - Programmatic use of raw SQL to build object graphs
    - Improvements to Automatic Query tuning


    JAX-RS Integration Module
    ---------------------------------------
    See http://www.avaje.org/ebean/jaxrs.html

    Provides out of the box REST like API to your entities (and hence DB).
    This is JSON only (no XML yet) and has no built in HATEOUS yet.
    We have built in JSON marshalling/unmarshalling into Ebean to deal
    with the ORM issues around partial objects for updates and queries.


    Scala types supported
    -----------------------------------
    You can use Scala Option and mutable collection types
    (Scala 2.8 mutable Buffer, Set and Map) in your entity beans
    rather than the java collection types.


    Programmatic use of raw SQL (to build object graphs)
    -------------------------------------------------------------------------------
    See http://www.avaje.org/ebean/introquery_rawsql.html

    Allows you to programmatically use raw SQL and define column mappings
    to build object graphs. A good way to work with aggregate functions.


    Improvements to Automatic Query tuning
    -------------------------------------------------------------
    This is where Ebean profiles the object graph use of your app and
    uses that information to tune the queries for you. There have been
    improvements in the "query joins" (using multiple SQL queries to
    build the object graph) that Autofetch is now using and you can mix
    manual tuning with Autofetch.


    Ebean ORM Overview (http://www.avaje.org)

    ---------------------------

    - Uses JPA annotations for Mapping

    - Sessionless API (no attach/detach merge/persist/flush)

    - Lazy loading just works

    - Supports Automatic Query tuning (Profile Object graph use to automatically tune your queries)

    - Partial Object support (for performance)

    - Stateless Updates

    - Transparent Encryption (via DB functions or Java encryption)

    - Support for Spring or JTA Transaction Managers

    - Background Fetching

    - and now JAX-RS Integration (JSON Only - not XML yet)

    - LGPL license


    Cheers, Rob and the Ebean team.

    Threaded Messages (8)

  2. I wonder who in his right mind would use this thing for serious stuff. If you doubt me download it and give it a try. It's just a joke. I tried it, posed some questions for help and for months that question is stiil not answered. Don't take that project serious.  This guy is just playing and don't make him waste your time. Consider the real thing, like Hibernate or JPA.

    Jan

     

  3. Home Grown ORMs[ Go to top ]

    There are indeed a large number of home grown ORMs out there, and partial projects that have picked up, and just as quickly, lost steam. 

    It's nice to give as many a voice as possible, especially on perhaps a slow news day. You never know which product will actually break out and be the next great thing.

  4. Sorry to hear that Jan.

    I am unaware of an unanswered question so perhaps you can point out where it is (obviously I missed it)?  Was it in the forum or google group?

    Yes people are using it. Mostly folks who are tired of issues related to session management. The "Automatic Query tuning" is a pretty serious feature that I'm sure the competitors would like - but hey, use the ORM you like. 

    Ta, Rob.

  5. It seems like you even don't read your own forum. You think open source project is just writing code and throwing it into the wild and then it all become the next big thing. Go and do you homework and come back when you have new facts.

  6. and Jan, your tongue is not appropriate.

    Have you ever tried to get help from the Hibernate forum? OMG, I remember that back with shudder.
    I've never seen someone more helpful than Rob.
    He is discussing things at our google mailinglist until both sides are happy.

    Obviously you think open source is just getting for free. A full fledged, error free, well documented library free to use for your needs.
    That simply is the wrong sight of it. Open source is community driven, by helping to test, code and surely writing documentation.
    You are invited to help on that. Or, at least donate to the project.

    Now, to the technical aspect of Ebean.
    If you don't like the stateless approach of Ebean, fine, you are free to express that and move on. No one harmed.

    I, as creator of Apache MyFaces Orchestra, spent a lot of time getting the session approach of Hibernate/JPA fly.
    Orchestra, and surely Seam, helps alot on that, but you still have to think about many things when coding,
    like passing around entities between various sessions (which is not possible). And then you even might end with an
    application using tons of memory just because you were not able to find a decent conversation lifetime and having all
    your entities cached in memory.
    You might wonder, there are many people out there using Hibernate but with a session-per-request pattern.
    Which effectively makes Hibernate act as if stateless. You have to deal with detached objects all around than.
    And this is much more error prone.

    Beside that, the autofetch feature is unbeaten, especially, but not only, if you have to deal with legacy databases with alot of fields
    per record this can speed up your database access alot as just the fields and constraints are fetched which are used by your program.
    AUTOMATICALLY! No fetch plan or so needed, no lazy or eager config necessary.

    Ebean had to go a long way to be considered stable, sure, but I use it with VERY success in our application
    (accessing legacy and nicely normalized database tables)
    and I am happy to know that there is a database layer at work which help me creating better and faster applications.

    Sure, as I am Ebean committer, you can treat this comment as biased, everyone else, try Ebean ... and don't forget to
    close you mouth again after the first excitement. ;-)

  7. Complete opposite experience[ Go to top ]

    hmm - a very aggressive tone Jan and pretty unfair comment in my opinion. I believe I am still pretty sane and have tried Ebean with a lot of success. In the past I've delivered large projects using hibernate and my motivation to first try Ebean and subsequently to become a contributor was driven by hibernate's poor architecture, the detach object/lazy loading nightmare  etc. So in Ebean I've found a lot of solutions to what typically plagues an hibernate app.

    I think you should read the ebean forum http://groups.google.com/group/ebean and you'll see there is quite a lot going on with pretty quick responses to any queries.  

    So to be fair I think you should tone down your remarks and stick to some facts - as there seems to be a lot more people out there "in their right mind" that are using Ebean very successfully. 

    One last thing, why did you actually want to try out ebean (your post to the forum) or where you not in your right mind at the time? 

  8. Why so hostile?[ Go to top ]

    Jan,

    That's an amazingly hostile tone to take - both in your initial comments and your response to Rob's very reasonable reply.  For heaven's sake man, all he did was ask you where you posted.  I've looked for your question too and can't find it.

    I use Ebean for 'serious business', after getting frustrated with Hibernate one too many times.  I've found it to be an excellent alternative.  

    Funnily enough, what's particularly impressed me - day after day - is the way in which questions to the group are replied to, and usually within hours.  Almost every single time a problem is raised, one of the developers responds very quickly and constructively - attempting to understand what the user was trying to do and helping them.  If it's a bug, there's usually a fix within a day, or a few days at the most.  Even if the problem is not within Ebean - a user misunderstanding, for example - often Rob will raise a bug to make the code clearer next time.  

    Releases are frequent, test suites are updated with every issue raised, and the developers' understanding of ORM theory - JPA, Hibernate and alternatives - is extremely high.  This is a small project but one which they run in a very professional manner.  

    So to recap - you say you posted a question - though you won't tell us where, or when, or on what topic - and that you didn't get a reply, and that therefore no one in the world should use this system for serious business.  This is unreasonable - and just wrong.

    Anyone who goes to the forum right now - http://groups.google.com/group/ebean - can check for themselves.  Every question has an almost immediate response, a bug raised for actual problems and help for misunderstandings, and bugs are turned around into fixes at a high rate.  Go and see for yourself.  And try EBean - it's the most impressive new project I've seen for ages.

     

    Regards,

    Alastair

     

     

     

     

  9. Unexpected behavior[ Go to top ]

    If you have a lot of experience with EJB, you might not have a problem with JPA. I don't have such experience and I'm surprised many times how it works. Do the following: open an EM, load object A, change a property on it, load object B change a property on it, start a transaction, merge object B, commit, close EM. Notice object A was not merged or "saved". Much to my surprise, the changes are in fact saved! I don't like this at all. There are a number of "gotchas" like this that frustrate me. Ebean doesn't have such problems and even allows lazy loading at any time (since there is no EM session). I find again and again that Ebean works the way I expect it to. As well, there are a lot of nice features beyond JPA-ish things like very good SQL integration. I can add a nasty SQL subquery to the where clause of my ORM query to satisfy the critera well beyond what even JPQL and Criteria API can do.