org.apache.ibatis.abator.api
Interface JavaModelGenerator

All Known Implementing Classes:
JavaModelGeneratorDefaultImpl, JavaModelGeneratorJava2Impl

public interface JavaModelGenerator

This interface describes methods needed in any Java model generator. A Java model generator is used to generate POJOs that match the structure of the table. Typically this includes:

Author:
Jeff Butler

Method Summary
 FullyQualifiedJavaType getExampleType(FullyQualifiedTable table)
           
 java.util.List getGeneratedJavaFiles(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, ProgressCallback callback)
          This method returns a list of GenerateJavaFile objects.
 FullyQualifiedJavaType getPrimaryKeyType(FullyQualifiedTable table)
           
 FullyQualifiedJavaType getRecordType(FullyQualifiedTable table)
           
 FullyQualifiedJavaType getRecordWithBLOBsType(FullyQualifiedTable table)
           
 void setProperties(java.util.Map properties)
          Sets the properties of the generator taken from the JavaModelGeneratorConfiguration element.
 void setTargetPackage(java.lang.String targetPackage)
          Sets the target package of the generator taken from the JavaModelGeneratorConfiguration element.
 void setTargetProject(java.lang.String targetProject)
          Sets the target project of the generator taken from the JavaModelGeneratorConfiguration element.
 void setWarnings(java.util.List warnings)
          Abator will supply a list to this method.
 

Method Detail

setProperties

public void setProperties(java.util.Map properties)
Sets the properties of the generator taken from the JavaModelGeneratorConfiguration element. This method is called before any getXXX method.

Parameters:
properties - the configuration element's properties

setWarnings

public void setWarnings(java.util.List warnings)
Abator 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 -

setTargetPackage

public void setTargetPackage(java.lang.String targetPackage)
Sets the target package of the generator taken from the JavaModelGeneratorConfiguration element. This method is called before any getXXX method.

Parameters:
targetPackage - the configuration element's target package

setTargetProject

public void setTargetProject(java.lang.String targetProject)
Sets the target project of the generator taken from the JavaModelGeneratorConfiguration element. This method is called before any getXXX method.

Parameters:
targetProject - the configuration element's target project

getPrimaryKeyType

public FullyQualifiedJavaType getPrimaryKeyType(FullyQualifiedTable table)

getRecordType

public FullyQualifiedJavaType getRecordType(FullyQualifiedTable table)
Parameters:
table - the table for which the name should be generated
Returns:
the type for the record (the class that holds non-primary key and non-BLOB fields). Note that the value will be calculated regardless of whether the table has these columns or not.

getExampleType

public FullyQualifiedJavaType getExampleType(FullyQualifiedTable table)
Parameters:
table - the table for which the name should be generated
Returns:
the type for the example class.

getRecordWithBLOBsType

public FullyQualifiedJavaType getRecordWithBLOBsType(FullyQualifiedTable table)
Parameters:
table - the table for which the name should be generated
Returns:
the type for the record with BLOBs class. Note that the value will be calculated regardless of whether the table has BLOB columns or not.

getGeneratedJavaFiles

public java.util.List getGeneratedJavaFiles(ColumnDefinitions columnDefinitions,
                                            TableConfiguration tableConfiguration,
                                            ProgressCallback callback)
This method returns a list of GenerateJavaFile objects. The list may include any, or all, of the following types of generated java classes:

Parameters:
columnDefinitions -
tableConfiguration -
callback -
Returns:
a list of GeneratedJavaFile objects