biz.hammurapi.sql
Class PropertyProjector

java.lang.Object
  extended by biz.hammurapi.sql.BaseReflectionProjector
      extended by biz.hammurapi.sql.PropertyProjector
All Implemented Interfaces:
Projector

public class PropertyProjector
extends BaseReflectionProjector
implements Projector

Projects fields from result set to object properties (fields or setters)

Version:
$Revision: 1.3 $
Author:
Pavel Vlasov

Constructor Summary
PropertyProjector(java.lang.Class objectClass, java.util.Map typeMap, java.util.Map fieldMap)
          Constructor
 
Method Summary
 java.lang.Object project(java.sql.ResultSet rs)
          Instantiates object using default constructors and then sets properties.
 
Methods inherited from class biz.hammurapi.sql.BaseReflectionProjector
accessorName, getColumn, getColumn, mutatorName, propertyName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyProjector

public PropertyProjector(java.lang.Class objectClass,
                         java.util.Map typeMap,
                         java.util.Map fieldMap)
Constructor

Parameters:
objectClass - Class to instantiate. Must have no-argument public constructor
typeMap - ResultSet.getObject(java.lang.String, java.util.Map)
fieldMap - Field map. Can be null. If value of some mapping is null then that field is suppressed and is not set.
lenient - If it is set to false than exception will be thrown if property to set does not exist.
toLowerCase - If set to true then database field names will be converted to lower case for field/setters discovery.
Method Detail

project

public java.lang.Object project(java.sql.ResultSet rs)
                         throws java.sql.SQLException
Instantiates object using default constructors and then sets properties.

Specified by:
project in interface Projector
Parameters:
rs - ResultSet
Returns:
Constructed object
Throws:
java.sql.SQLException


Copyright © 2003 Hammurapi Group. All Rights Reserved.