Hi,
I think the preferred solution could be, something like:
Generate a XXXIterator.java, which encapsulates the ResultSet, and
one-by-one creates the persistent objects.
public XXXIterator extends BaseIterator {
...
public XXX nextXXX();
// for java.util.Iterator
public Object next();
public boolean hasNext();
// to close the ResultSet, release the Connection
// probably 'hasNext()' should call this, in the end of the ResultSet
public void close();
}
and create a method in BaseXXXPeer.java :
public XXXIterator doSelectToIterator(Criteria criteria);
As i look through the code, this could be an easy solution, however i
found two possible 'weaknes' :
1, we must make some ugly hack, to use com.workingdogs.village.Record,
because all of it's constructor need a village.DataSet, or we must
make the necessary conversion from ResultSet -> BaseXXX by hand.
Or we could make a row2Object/populateObject which accept not a
village.Record, but an array of village.Value-s (I think, this is the
nicest version)
2, warn the developer to not to forget to close the XXXIterator, with
the explicit close() method call, or just iterateing through the
resultset
Bye
Zsombor Gegesy
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>