Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

O/R Hell

Thread view: 
JavaEnquirer - 14 Nov 2006 14:08 GMT
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.
David Segall - 14 Nov 2006 14:51 GMT
> 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>.
Alex Hunsley - 14 Nov 2006 15:32 GMT
> 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.
WuyaSea Operator - 14 Nov 2006 23:22 GMT
3 words, ruby on rails. dead simple.

> 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
[quoted text clipped - 37 lines]
> trickier stuff. I'm finding it increasingly hard to justify our use of
> Java to myself.
warren.mayocchi@gmail.com - 24 Nov 2006 04:07 GMT
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.
}
//---------------------------------------------------------


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.