Re: Converting a ResultSet to a List of POJOs

2003-09-09 Thread K.C. Baltz
Since I had to look it up, maybe others did too: POJO = Plain Old Java Object. I'm guessing that means a Java object that doesn't need to know how it is persisted in order to be stored? I.e., in Matt's case, the object isn't modified to take ResultSet as an argument to the constructor. K.C.

Re: Converting a ResultSet to a List of POJOs

2003-09-09 Thread Adam Levine
a POJO is just that. just an ordinary, everyday object. you might also think of it as a traditional Java bean. it has an empty param constructor, and get/setXXX signatures. From: K.C. Baltz [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List

RE: Converting a ResultSet to a List of POJOs

2003-09-09 Thread Andrew Hill
Everyday object? You serious? Who uses those now? I mean it doesnt even come with 50,000 xml files to specify deployment metainfo s old fashioned! -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Tuesday, 9 September 2003 16:31 To: [EMAIL PROTECTED] Subject:

RE: Converting a ResultSet to a List of POJOs

2003-09-09 Thread Jerry Jalenak
Matt - After reading your post here and on the iBatis forum on SF, I thought I'd run some tests on my authentication process as well. I'm using a static block to initially read in the sql-map.xml file, and am using the sqlMap.executeQueryForObject method w/o a 'true' DAO (calling the method

Re: Converting a ResultSet to a List of POJOs

2003-09-09 Thread Vic Cekvenic
By using a static class intilizer in the DAO, JNDI, Pool and XML phrase happen once for the entire web app. iBatis I found much faster and simpler that others. .V Jerry Jalenak wrote: Matt - After reading your post here and on the iBatis forum on SF, I thought I'd run some tests on my

RE: Converting a ResultSet to a List of POJOs

2003-09-08 Thread Hugh Brien
You could also consider using Torque. I believe it will generate a schema from an existing database that will allow you build a set of data aware objects. It also some good classes for working directly with XML. I wrote a simple Struts plugin to work with Torque. It's not as cool as Hibernate

RE: Converting a ResultSet to a List of POJOs

2003-09-08 Thread Jerry Jalenak
+1. Simplest method I've seen to go from a ResultSet to a Collection of JavaBeans Jerry Jalenak Team Lead, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent:

RE: Converting a ResultSet to a List of POJOs

2003-09-08 Thread Matt Raible
Thanks to all for your suggestions. I did some number comparisons b/w the standard way (rs.next() ... set, set, set), ibatis, and ResultSetUtils.getCollection() from scaffold. Here's what I found: 1. Standard way - 0.24 seconds 2. ibatis - 5+ seconds (ugh! - maybe I'm doing something wrong,

Re: Converting a ResultSet to a List of POJOs

2003-09-06 Thread Vic Cekvenich
There are no people more expert in Struts than you Matt. I think you can use RowSet to wrap a ResultSet, and RowSet has a toCollection or getCollection method. (Or just don't user ResultSet at all, just use RowSet, Sun has default implementation in JDC, but Orcale has an extra download, other

RE: Converting a ResultSet to a List of POJOs

2003-09-06 Thread Todd G. Nist
Matt, If you pull the scaffold project from http://sourceforge.net/project/showfiles.php?group_id=49385, there is a class called ResultSetUtils which provides the below methods for mapping a ResultSet to a Collection of a given class or returning a given element from the ResultSet. It uses

Re: Converting a ResultSet to a List of POJOs

2003-09-06 Thread Ted Husted
I'm about to try iBATIS www.ibatis.com for a new phase of a project we started in Hibernate. Hibernate is cool, but I think something simpler might be a better fit. (Not sure if we really need that finely grained object layer after all :) It will let you remove the SQL to a simple XML file and

Re: Converting a ResultSet to a List of POJOs

2003-09-06 Thread Joe Germuska
We wrote something like this at work: ResultSetTransformer is an interface with a single method: public Object instanceFromRow(java.sql.ResultSet rset) throws java.lang.Exception; We mostly use a single implementation of the interface which we call SimplePropertyMappedTransformerYou

Re: Converting a ResultSet to a List of POJOs

2003-09-05 Thread Micael
I assume you don't mean something like: brbr List list = null;br try {br list = Collections.synchronizedList(new LinkedList());br User user = null;br CompositeEntity composite = new CompositeEntity();br while(rs.next()) {br user = composite.getUserVO();br

RE: Converting a ResultSet to a List of POJOs

2003-09-05 Thread Matt Raible
This is what I'm trying to get away from. -Original Message- From: Micael [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 5:19 PM To: Struts Users Mailing List Subject: Re: Converting a ResultSet to a List of POJOs I assume you don't mean something like: brbr List list

RE: Converting a ResultSet to a List of POJOs

2003-09-05 Thread Micael
I might as well go ahead and state boldly what I was trying to imply, Matt. If you notice the CompositeEntity, then you can imagine altering that to include two changes to the norm. First, you can make all the composite entities of the same type, and, second, you can change .getUserVO() to

RE: Converting a ResultSet to a List of POJOs

2003-09-05 Thread Micael
Okay, gotcha. At least it had a List. LOL. At 06:20 PM 9/5/2003 -0500, you wrote: This is what I'm trying to get away from. -Original Message- From: Micael [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 5:19 PM To: Struts Users Mailing List Subject: Re: Converting a

Re: Converting a ResultSet to a List of POJOs

2003-09-05 Thread Kris Schneider
So far, I think I prefer JSTL's Result interface for this type of operation: import javax.servlet.jsp.jstl.sql.Result; import javax.servlet.jsp.jstl.sql.ResultSupport; ... ResultSet rs = ...; Result result = ResultSupport.toResult(rs); request.setAttribute(result, result); ... Here's the javap on