org.hydrateframework
Interface Assembler.Discriminator

All Known Implementing Classes:
Assembler.TestCol, Assembler.TestKey
Enclosing class:
Assembler

public static interface Assembler.Discriminator

This interface is used to determine whether an object should be built or not. In general, an assembler will build an instance of its object from a query provided the primary key of the object is available in the query. There are instances however, where the assembler should only build the object depending on an arbitrary ResultSet dependent expression. This requirement is met by allowing the user of the assembler to supply an arbitrary expression via the Discriminator interface when calling prepareToProcessResults(java.sql.ResultSet, java.util.Map) on the assembler.


Method Summary
 boolean prepareToProcessResults(java.sql.ResultSet rs, java.util.Map columns)
          This call gives the object an opportunity to find the column indexes of any fields of interest to the calculation
 boolean shouldBuild(Assembler bld)
          Determine if the object should be built based on information from the current row of the query.
 

Method Detail

prepareToProcessResults

boolean prepareToProcessResults(java.sql.ResultSet rs,
                                java.util.Map columns)
This call gives the object an opportunity to find the column indexes of any fields of interest to the calculation

Parameters:
rs - The ResultSet object holding the data from which objects are about to be built
columns - a mapping between the names of columns found in the query and the names of attributes that this assembler's object is expecting.
Returns:
true if there were no problems

shouldBuild

boolean shouldBuild(Assembler bld)
Determine if the object should be built based on information from the current row of the query.

Parameters:
bld - the assembler that is about to try to build an object
Returns:
true if the object should be built, false otherwise.


Copyright © 2000 The Hydrate Project. All Rights Reserved.