O/R Hell

Discussion in 'Java' started by JavaEnquirer, Nov 14, 2006.

  1. JavaEnquirer

    JavaEnquirer Guest

    I don't "get" Hibernate. ( At least for the kinds of projects I work on
    - small/medium information systems, nothing too complex, the kind of
    thing you could do with Microsoft Access. )

    I don't want to jump through hoops to map my ResultSets into objects
    and I don't need to worry about the back-end database changing - it
    just won't!! Hibernate should do the trick, but I find it so damn
    awkward, time consuming and fussy, full of features I'll never need.
    Stupid I know, but you can feel is if you are doing something wrong if
    you are not using the "in" technologies. For me, I don't want to have
    to type in more than the following:

    StoredProcedureExecuter executer =

    StoredProcedureFactory.getStoredProcedureExecuter("connectionAlias",
    "mySp");
    executer.addParams(param1, param2, param3);

    ArrayList<Customer> customerList = ResultSetMapper.map(Customer.class,
    executer.execute());

    executer.close();

    The above is rough, off the top of my head example of how I do things
    on my projects. No mapping required, everything handled by reflection
    and db naming conventions. Seems far easier than Hibernate. However,
    it's not a complete framework, and we sometimes go back to vanilla JDBC
    for complex joins and for changing data. I was wondering if there's a
    library/tool out there that's as easy to use as the code snippet shown
    above, but is more complete and powerful. I'm thinking of something
    akin to a database version of Wicket - no XML and using the best tool
    for the job i.e. writing stored procedures using the DB vendor's tools
    and wizards, no thrashing around wondering what columns are in what
    tables, entering typo hell and debugging the tag soup.

    Any ideas anyone? I don't enter the J2EE world often and when I do it
    scares me. Java doesn't seem to be getting that much easier. Our outfit
    is thinking of moving to some kind of new 4GL Rad tool for quickly
    knocking out the 80% of simple stuff we do, and using .NET for the
    trickier stuff. I'm finding it increasingly hard to justify our use of
    Java to myself.
     
    JavaEnquirer, Nov 14, 2006
    #1
    1. Advertising

  2. JavaEnquirer

    David Segall Guest

    "JavaEnquirer" <> wrote:

    > I was wondering if there's a
    >library/tool out there that's as easy to use as the code snippet shown
    >above, but is more complete and powerful.

    Have you looked at Java Studio Creator
    <http://developers.sun.com/prodtech/javatools/jscreator/index.jsp>?
    It's an easy to use RAD tool that produces Java Server Faces
    applications. The functionality is also available in Netbeans
    <www.netbeans.org>.
     
    David Segall, Nov 14, 2006
    #2
    1. Advertising

  3. JavaEnquirer

    Alex Hunsley Guest

    JavaEnquirer wrote:
    > I don't "get" Hibernate. ( At least for the kinds of projects I work on
    > - small/medium information systems, nothing too complex, the kind of
    > thing you could do with Microsoft Access. )
    >
    > I don't want to jump through hoops to map my ResultSets into objects
    > and I don't need to worry about the back-end database changing - it


    Have you looked at Torque?
    http://db.apache.org/torque/
    Lightweight ORB. May do the trick - simpler than hibernate, that's for sure.
     
    Alex Hunsley, Nov 14, 2006
    #3
  4. 3 words, ruby on rails. dead simple.


    JavaEnquirer wrote:
    > I don't "get" Hibernate. ( At least for the kinds of projects I work on
    > - small/medium information systems, nothing too complex, the kind of
    > thing you could do with Microsoft Access. )
    >
    > I don't want to jump through hoops to map my ResultSets into objects
    > and I don't need to worry about the back-end database changing - it
    > just won't!! Hibernate should do the trick, but I find it so damn
    > awkward, time consuming and fussy, full of features I'll never need.
    > Stupid I know, but you can feel is if you are doing something wrong if
    > you are not using the "in" technologies. For me, I don't want to have
    > to type in more than the following:
    >
    > StoredProcedureExecuter executer =
    >
    > StoredProcedureFactory.getStoredProcedureExecuter("connectionAlias",
    > "mySp");
    > executer.addParams(param1, param2, param3);
    >
    > ArrayList<Customer> customerList = ResultSetMapper.map(Customer.class,
    > executer.execute());
    >
    > executer.close();
    >
    > The above is rough, off the top of my head example of how I do things
    > on my projects. No mapping required, everything handled by reflection
    > and db naming conventions. Seems far easier than Hibernate. However,
    > it's not a complete framework, and we sometimes go back to vanilla JDBC
    > for complex joins and for changing data. I was wondering if there's a
    > library/tool out there that's as easy to use as the code snippet shown
    > above, but is more complete and powerful. I'm thinking of something
    > akin to a database version of Wicket - no XML and using the best tool
    > for the job i.e. writing stored procedures using the DB vendor's tools
    > and wizards, no thrashing around wondering what columns are in what
    > tables, entering typo hell and debugging the tag soup.
    >
    > Any ideas anyone? I don't enter the J2EE world often and when I do it
    > scares me. Java doesn't seem to be getting that much easier. Our outfit
    > is thinking of moving to some kind of new 4GL Rad tool for quickly
    > knocking out the 80% of simple stuff we do, and using .NET for the
    > trickier stuff. I'm finding it increasingly hard to justify our use of
    > Java to myself.
     
    WuyaSea Operator, Nov 14, 2006
    #4
  5. JavaEnquirer

    Guest

    Have a look at ResultSetMapper
    (http://resultsetmapper.sourceforge.net):

    //---------------------------------------------------------
    public class JellyCompany {
    @MapToData
    String companyName;
    @MapToData ( columnAliases= { "company_address" } )
    String address;
    ...
    }

    //---------------------------------------------------------
    ResultSet results = stmt.executeQuery("SELECT * FROM jelly_companies");

    ResultSetMapper<JellyCompany> resultSetMapper = new
    ReflectionResultSetMapper<JellyCompany>(JellyCompany.class);

    while (results.next()) {
    JellyCompany jellyCompany = resultSetMapper.mapRow(resultSet);
    // Order some jelly beans.
    }
    //---------------------------------------------------------
     
    , Nov 24, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Allan Wong

    DLL Hell in .NET

    Allan Wong, Sep 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,781
    Mark Kamoski
    Sep 25, 2003
  2. Talon

    Circle Hell

    Talon, Sep 4, 2003, in forum: Perl
    Replies:
    2
    Views:
    1,122
    Mark Carter
    Sep 4, 2003
  3. KathyB
    Replies:
    0
    Views:
    342
    KathyB
    Jul 23, 2003
  4. BeerBoy

    DLL Hell

    BeerBoy, Feb 23, 2004, in forum: ASP .Net
    Replies:
    8
    Views:
    534
    Kevin Spencer
    Feb 24, 2004
  5. Steve Peterson

    Image hell(p)

    Steve Peterson, Jun 14, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    447
    S. Justin Gengo
    Jun 15, 2004
Loading...

Share This Page