Search in sources :

Example 6 with AbstractJavaGenerator

use of org.mybatis.generator.codegen.AbstractJavaGenerator in project generator by mybatis.

the class IntrospectedTableMyBatis3Impl method getGeneratedJavaFiles.

/* (non-Javadoc)
     * @see org.mybatis.generator.api.IntrospectedTable#getGeneratedJavaFiles()
     */
@Override
public List<GeneratedJavaFile> getGeneratedJavaFiles() {
    List<GeneratedJavaFile> answer = new ArrayList<GeneratedJavaFile>();
    for (AbstractJavaGenerator javaGenerator : javaModelGenerators) {
        List<CompilationUnit> compilationUnits = javaGenerator.getCompilationUnits();
        for (CompilationUnit compilationUnit : compilationUnits) {
            GeneratedJavaFile gjf = new GeneratedJavaFile(compilationUnit, context.getJavaModelGeneratorConfiguration().getTargetProject(), context.getProperty(PropertyRegistry.CONTEXT_JAVA_FILE_ENCODING), context.getJavaFormatter());
            answer.add(gjf);
        }
    }
    for (AbstractJavaGenerator javaGenerator : clientGenerators) {
        List<CompilationUnit> compilationUnits = javaGenerator.getCompilationUnits();
        for (CompilationUnit compilationUnit : compilationUnits) {
            GeneratedJavaFile gjf = new GeneratedJavaFile(compilationUnit, context.getJavaClientGeneratorConfiguration().getTargetProject(), context.getProperty(PropertyRegistry.CONTEXT_JAVA_FILE_ENCODING), context.getJavaFormatter());
            answer.add(gjf);
        }
    }
    return answer;
}
Also used : CompilationUnit(org.mybatis.generator.api.dom.java.CompilationUnit) AbstractJavaGenerator(org.mybatis.generator.codegen.AbstractJavaGenerator) ArrayList(java.util.ArrayList) GeneratedJavaFile(org.mybatis.generator.api.GeneratedJavaFile)

Aggregations

AbstractJavaGenerator (org.mybatis.generator.codegen.AbstractJavaGenerator)6 ArrayList (java.util.ArrayList)2 GeneratedJavaFile (org.mybatis.generator.api.GeneratedJavaFile)2 CompilationUnit (org.mybatis.generator.api.dom.java.CompilationUnit)2 DAOGenerator (org.mybatis.generator.codegen.ibatis2.dao.DAOGenerator)1 GenericCIDAOTemplate (org.mybatis.generator.codegen.ibatis2.dao.templates.GenericCIDAOTemplate)1 GenericSIDAOTemplate (org.mybatis.generator.codegen.ibatis2.dao.templates.GenericSIDAOTemplate)1 IbatisDAOTemplate (org.mybatis.generator.codegen.ibatis2.dao.templates.IbatisDAOTemplate)1 SpringDAOTemplate (org.mybatis.generator.codegen.ibatis2.dao.templates.SpringDAOTemplate)1 BaseRecordGenerator (org.mybatis.generator.codegen.ibatis2.model.BaseRecordGenerator)1 ExampleGenerator (org.mybatis.generator.codegen.ibatis2.model.ExampleGenerator)1 PrimaryKeyGenerator (org.mybatis.generator.codegen.ibatis2.model.PrimaryKeyGenerator)1 RecordWithBLOBsGenerator (org.mybatis.generator.codegen.ibatis2.model.RecordWithBLOBsGenerator)1 BaseRecordGenerator (org.mybatis.generator.codegen.mybatis3.model.BaseRecordGenerator)1 ExampleGenerator (org.mybatis.generator.codegen.mybatis3.model.ExampleGenerator)1 PrimaryKeyGenerator (org.mybatis.generator.codegen.mybatis3.model.PrimaryKeyGenerator)1 RecordWithBLOBsGenerator (org.mybatis.generator.codegen.mybatis3.model.RecordWithBLOBsGenerator)1 SimpleModelGenerator (org.mybatis.generator.codegen.mybatis3.model.SimpleModelGenerator)1