com.townleyenterprises.persistence
Interface ResultRow


public interface ResultRow

This interface should be implemented by classes that wish to be dynamicly loaded from the DynamicFinder based on the results of the execution of a query.

From the Jaxor perspective, this is a really simple version of an EntityRow because the classes which implement this interface alone are not interested in being persisted to the database. It is also effectively merging the functionality of the AbstractMapper class because no dynamic mapping functionality is required either.

Version:
$Id: ResultRow.java,v 1.3 2004/07/28 10:33:59 atownley Exp $
Author:
Andrew S. Townley

Method Summary
 void load(java.sql.ResultSet results)
          This method needs to be implemented in order to populate an implementing class based on the values of the ResultSet.
 ResultRow newInstance()
          This method allows ResultRow instances to act as prototypes so that non-public classes can be used to retrieve DynamicFinder results.
 

Method Detail

load

public void load(java.sql.ResultSet results)
          throws java.sql.SQLException
This method needs to be implemented in order to populate an implementing class based on the values of the ResultSet. It isn't perfect, but it alieviates almost all of the SQL drudgery from what are really (in our case, anyway) static Value Objects in the Sun J2EE sense of the term, or Data Transfer Objects in the Fowler sense of the term.

Parameters:
results - the ResultSet instance for this row
Throws:
java.sql.SQLException - if accessing the data fails for whatever reason

newInstance

public ResultRow newInstance()
This method allows ResultRow instances to act as prototypes so that non-public classes can be used to retrieve DynamicFinder results.

Returns:
a new ResultRow instance


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.