org.pojava.persistence.sql
Class DefaultAdaptorMap<I,O>

java.lang.Object
  extended by org.pojava.persistence.sql.DefaultAdaptorMap<I,O>
All Implemented Interfaces:
AdaptorMap<I,O>

public class DefaultAdaptorMap<I,O>
extends Object
implements AdaptorMap<I,O>

DefaultAdaptorMap is a rules engine for determining which BindingAdaptor to use to translate data between a database field and a bean property. It uses the (method + columnClass) as search criteria. The search attempts to derive a best fitting Adaptor for that property. Adaptors are stateless, so the algorithm strives for adaptor reuse. The vision: A default can be supplied for the property returnType. An optional user-defined override can finesse column types where needed.

Author:
John Pile

Constructor Summary
DefaultAdaptorMap()
           
 
Method Summary
 org.pojava.transformation.BindingAdaptor chooseAdaptor(Method method, Class columnClass)
          Select an adaptor based on a variety of possible criteria.
static DefaultAdaptorMap<?,?> getInstance()
          Return a reference to this reentrant class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAdaptorMap

public DefaultAdaptorMap()
Method Detail

chooseAdaptor

public org.pojava.transformation.BindingAdaptor chooseAdaptor(Method method,
                                                              Class columnClass)
Select an adaptor based on a variety of possible criteria.

Specified by:
chooseAdaptor in interface AdaptorMap<I,O>
Parameters:
method - a method
columnClass - the type of the drilled-down property
Returns:
BindingAdaptor satisfying that property

getInstance

public static DefaultAdaptorMap<?,?> getInstance()
Return a reference to this reentrant class.

Returns:
a reference to this reentrant class


Copyright © 2011. All Rights Reserved.