org.apache.ibatis.ibator.api
Interface JavaTypeResolver

All Known Implementing Classes:
JavaTypeResolverDefaultImpl

public interface JavaTypeResolver

This interface describes methods that are required in any Java type resolver. A Java type resolver is used to make a default translation between a JDBC type as returned from the database introspection process, and a Java type.

Author:
Jeff Butler

Method Summary
 void addConfigurationProperties(java.util.Properties properties)
          Adds properties for this instance from any properties configured in the JavaTypeResolverConfiguration.
 FullyQualifiedJavaType calculateJavaType(IntrospectedColumn introspectedColumn)
          Calculates and returns the Java type that should be associated with this column based on the jdbc type, length, and scale of the column.
 void setIbatorContext(IbatorContext ibatorContext)
          Sets the instance of the IbatorConfiguration object associated with this instance.
 void setWarnings(java.util.List<java.lang.String> warnings)
          ibator will supply a list to this method.
 

Method Detail

addConfigurationProperties

void addConfigurationProperties(java.util.Properties properties)
Adds properties for this instance from any properties configured in the JavaTypeResolverConfiguration. This method will be called before any of the get methods.

Parameters:
properties - All properties from the configuration

setIbatorContext

void setIbatorContext(IbatorContext ibatorContext)
Sets the instance of the IbatorConfiguration object associated with this instance. This method will be called before any of the get methods.

Parameters:
ibatorContext - The current IbatorContext

setWarnings

void setWarnings(java.util.List<java.lang.String> warnings)
ibator will supply a list to this method. The implementation class may add strings to the list that will be treated as warning messages and displayed to the user. The concept of a warning is that code generation can continue, but that the results may not be what is expected.

Parameters:
warnings -

calculateJavaType

FullyQualifiedJavaType calculateJavaType(IntrospectedColumn introspectedColumn)
Calculates and returns the Java type that should be associated with this column based on the jdbc type, length, and scale of the column.

Parameters:
introspectedColumn - the column whose Java type needs to be calculated
Returns:
true the calculated type, or null if an unsupported data type. If null is returned, ibator will set the type to Object and issue a warning unless the column is ignored or otherwise overridden