|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ibatis.abator.internal.java.BaseJavaCodeGenerator
org.apache.ibatis.abator.internal.java.DAOGeneratorBaseImpl
This class generates DAO classes based on the values in the supplied DAOGeneratorTemplate. This class supports the following properties:
Field Summary | |
protected DAOGeneratorTemplate |
daoGeneratorTemplate
|
protected JavaModelGenerator |
javaModelGenerator
|
protected java.util.Map |
properties
|
protected SqlMapGenerator |
sqlMapGenerator
|
protected java.lang.String |
targetPackage
|
protected java.lang.String |
targetProject
|
protected java.util.List |
warnings
|
Fields inherited from class org.apache.ibatis.abator.internal.java.BaseJavaCodeGenerator |
lineSeparator |
Constructor Summary | |
DAOGeneratorBaseImpl()
|
Method Summary | |
abstract DAOGeneratorTemplate |
getDAOGeneratorTemplate()
Returns the template used to generate DAOs from the implementing final class. |
protected GeneratedJavaFile |
getDAOImplementation(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration)
|
protected FullyQualifiedJavaType |
getDAOImplementationType(FullyQualifiedTable table)
|
protected GeneratedJavaFile |
getDAOInterface(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration)
|
protected FullyQualifiedJavaType |
getDAOInterfaceType(FullyQualifiedTable table)
|
protected java.lang.String |
getDAOPackage(FullyQualifiedTable table)
|
protected java.util.List |
getDeleteByExampleMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.util.List |
getDeleteByPrimaryKeyMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.lang.String |
getExampleParmsMethod(ColumnDefinition cd,
FullyQualifiedTable table)
This method returns a properly formatted method that sets up example parms for an individual column. |
java.util.List |
getGeneratedJavaFiles(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
ProgressCallback callback)
This method returns a list of GenerateJavaFile objects. |
protected java.util.List |
getGetExampleParmsMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.util.List |
getInsertMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.util.List |
getSelectByExampleMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.util.List |
getSelectByExampleWithBLOBsMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.util.List |
getSelectByPrimaryKeyMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.util.List |
getUpdateByPrimaryKeyMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
protected java.util.List |
getUpdateByPrimaryKeyWithBLOBsMethods(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
boolean interfaceMethod,
java.util.Set imports)
|
void |
setJavaModelGenerator(JavaModelGenerator javaModelGenerator)
Sets the instance of JavaModelGenerator associated with this instance. |
void |
setProperties(java.util.Map properties)
Sets unique properties for this instance. |
void |
setSqlMapGenerator(SqlMapGenerator sqlMapGenerator)
Sets the instance of SqlMapGenerator associated with this instance. |
void |
setTargetPackage(java.lang.String targetPackage)
Sets the target package for this instance. |
void |
setTargetProject(java.lang.String targetProject)
|
void |
setWarnings(java.util.List warnings)
Abator will supply a list to this method. |
Methods inherited from class org.apache.ibatis.abator.internal.java.BaseJavaCodeGenerator |
getFieldComment, getFieldComment, getGetterMethodComment, getMethodComment, getMethodComment, getSetterMethodComment, indent, newLine |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.List warnings
protected java.util.Map properties
protected java.lang.String targetPackage
protected java.lang.String targetProject
protected JavaModelGenerator javaModelGenerator
protected SqlMapGenerator sqlMapGenerator
protected DAOGeneratorTemplate daoGeneratorTemplate
Constructor Detail |
public DAOGeneratorBaseImpl()
Method Detail |
public abstract DAOGeneratorTemplate getDAOGeneratorTemplate()
public void setProperties(java.util.Map properties)
DAOGenerator
setProperties
in interface DAOGenerator
properties
- All properties from the configurationpublic void setTargetPackage(java.lang.String targetPackage)
DAOGenerator
setTargetPackage
in interface DAOGenerator
targetPackage
- The target package from the configurationpublic void setJavaModelGenerator(JavaModelGenerator javaModelGenerator)
DAOGenerator
setJavaModelGenerator
in interface DAOGenerator
javaModelGenerator
- The JavaModelGenerator associated with this instancepublic void setSqlMapGenerator(SqlMapGenerator sqlMapGenerator)
DAOGenerator
setSqlMapGenerator
in interface DAOGenerator
sqlMapGenerator
- The SqlMapGenerator associated with this instanceprotected FullyQualifiedJavaType getDAOImplementationType(FullyQualifiedTable table)
protected FullyQualifiedJavaType getDAOInterfaceType(FullyQualifiedTable table)
protected java.lang.String getDAOPackage(FullyQualifiedTable table)
protected GeneratedJavaFile getDAOImplementation(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration)
protected GeneratedJavaFile getDAOInterface(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration)
public void setTargetProject(java.lang.String targetProject)
setTargetProject
in interface DAOGenerator
targetProject
- public java.util.List getGeneratedJavaFiles(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, ProgressCallback callback)
DAOGenerator
getGeneratedJavaFiles
in interface DAOGenerator
columnDefinitions
- tableConfiguration
- callback
-
protected java.util.List getInsertMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.util.List getUpdateByPrimaryKeyMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
columnDefinitions
- column definitions for the current tabletableConfiguration
- table configuration for the current tableinterfaceMethod
- true if the method is an interface method, false if the method
is an implementation methodimports
- the method can add FullyQualifiedJavaType objects to this set
if they are required by the resulting method
protected java.util.List getUpdateByPrimaryKeyWithBLOBsMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.util.List getSelectByExampleMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.util.List getSelectByExampleWithBLOBsMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.util.List getSelectByPrimaryKeyMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.util.List getDeleteByExampleMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.util.List getDeleteByPrimaryKeyMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.util.List getGetExampleParmsMethods(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, boolean interfaceMethod, java.util.Set imports)
protected java.lang.String getExampleParmsMethod(ColumnDefinition cd, FullyQualifiedTable table)
getExampleParms
method. The expectation is
that there will be one column based method for each column in the table
(except BLOB columns). We do it this way to avoid generating one huge
method - which in some cases can actually be too large to compile. The
generated method should have this signature:
private Map getXXXXExampleParms(YYYY example)Where XXXX is the column name and YYYY is the example class
cd
- the column for which the method should be generatedtable
- the table in which the column exists
public void setWarnings(java.util.List warnings)
DAOGenerator
setWarnings
in interface DAOGenerator
warnings
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |