当前位置: 首页>>代码示例>>Java>>正文


Java ObjectFactory类代码示例

本文整理汇总了Java中org.mybatis.generator.internal.ObjectFactory的典型用法代码示例。如果您正苦于以下问题:Java ObjectFactory类的具体用法?Java ObjectFactory怎么用?Java ObjectFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ObjectFactory类属于org.mybatis.generator.internal包,在下文中一共展示了ObjectFactory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RootClassInfo

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
private RootClassInfo(String className, List<String> warnings) {
    super();
    this.className = className;
    this.warnings = warnings;

    if (className == null) {
        return;
    }
    
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(className);
    String nameWithoutGenerics = fqjt.getFullyQualifiedNameWithoutTypeParameters();
    if (!nameWithoutGenerics.equals(className)) {
        genericMode = true;
    }

    try {
        Class<?> clazz = ObjectFactory.externalClassForName(nameWithoutGenerics);
        BeanInfo bi = Introspector.getBeanInfo(clazz);
        propertyDescriptors = bi.getPropertyDescriptors();
    } catch (Exception e) {
        propertyDescriptors = null;
        warnings.add(getString("Warning.20", className)); //$NON-NLS-1$
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:25,代码来源:RootClassInfo.java

示例2: RootClassInfo

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
private RootClassInfo(String className, List<String> warnings) {
    super();
    this.className = className;
    this.warnings = warnings;

    if (className == null) {
        return;
    }

    try {
        Class<?> clazz = ObjectFactory.externalClassForName(className);
        BeanInfo bi = Introspector.getBeanInfo(clazz);
        propertyDescriptors = bi.getPropertyDescriptors();
    } catch (Exception e) {
        propertyDescriptors = null;
        warnings.add(getString("Warning.20", className)); //$NON-NLS-1$
    }
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:19,代码来源:RootClassInfo.java

示例3: getIntrospectedTables

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
private IntrospectedTable getIntrospectedTables(Context context) {
    IntrospectedTable table = null;
    JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(context);
    Connection connection = null;
    try {
        connection = getConnection(context.getJdbcConnectionConfiguration());
        DatabaseIntrospector databaseIntrospector =
                new DatabaseIntrospector(context, connection.getMetaData(), javaTypeResolver);
        table = databaseIntrospector.introspectTables(context.getTabconfig());
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
        closeConnection(connection);
    }
    return table;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:17,代码来源:CodeServiceImpl.java

示例4: RootClassInfo

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
private RootClassInfo(String className, List<String> warnings) {
	super();
	this.className = className;
	this.warnings = warnings;

	if (className == null) {
		return;
	}

	try {
		Class<?> clazz = ObjectFactory.externalClassForName(className);
		BeanInfo bi = Introspector.getBeanInfo(clazz);
		propertyDescriptors = bi.getPropertyDescriptors();
	} catch (Exception e) {
		propertyDescriptors = null;
		warnings.add(getString("Warning.20", className)); //$NON-NLS-1$
	}
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:19,代码来源:RootClassInfo.java

示例5: getCommentGenerator

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
/**
 * Gets the comment generator.
 *
 * @return the comment generator
 */
public CommentGenerator getCommentGenerator() {
    if (commentGenerator == null) {
        commentGenerator = ObjectFactory.createCommentGenerator(this);
    }

    return commentGenerator;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:13,代码来源:Context.java

示例6: getJavaFormatter

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
/**
 * Gets the java formatter.
 *
 * @return the java formatter
 */
public JavaFormatter getJavaFormatter() {
    if (javaFormatter == null) {
        javaFormatter = ObjectFactory.createJavaFormatter(this);
    }

    return javaFormatter;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:13,代码来源:Context.java

示例7: getXmlFormatter

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
/**
 * Gets the xml formatter.
 *
 * @return the xml formatter
 */
public XmlFormatter getXmlFormatter() {
    if (xmlFormatter == null) {
        xmlFormatter = ObjectFactory.createXmlFormatter(this);
    }

    return xmlFormatter;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:13,代码来源:Context.java

示例8: getDriver

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
private Driver getDriver(JDBCConnectionConfiguration connectionInformation) {
    String driverClass = connectionInformation.getDriverClass();
    Driver driver;

    try {
        Class<?> clazz = ObjectFactory.externalClassForName(driverClass);
        driver = (Driver) clazz.newInstance();
    } catch (Exception e) {
        throw new RuntimeException(getString("RuntimeError.8"), e); //$NON-NLS-1$
    }

    return driver;
}
 
开发者ID:backkoms,项目名称:mybatis-generator-comments,代码行数:14,代码来源:ConnectionFactory.java

示例9: calculateIntrospectedTables

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
private IntrospectedTable calculateIntrospectedTables(TableConfiguration tc,
        Map<ActualTableName, List<IntrospectedColumn>> columns) {
    boolean delimitIdentifiers =
            tc.isDelimitIdentifiers() || stringContainsSpace(tc.getCatalog())
                    || stringContainsSpace(tc.getSchema()) || stringContainsSpace(tc.getTableName());

    IntrospectedTable introspectedTable = null;
    for (Map.Entry<ActualTableName, List<IntrospectedColumn>> entry : columns.entrySet()) {
        ActualTableName atn = entry.getKey();

        // we only use the returned catalog and schema if something was
        // actually
        // specified on the table configuration. If something was returned
        // from the DB for these fields, but nothing was specified on the
        // table
        // configuration, then some sort of DB default is being returned
        // and we don't want that in our SQL
        FullyQualifiedTable table =
                new FullyQualifiedTable(stringHasValue(tc.getCatalog()) ? atn.getCatalog() : null,
                        stringHasValue(tc.getSchema()) ? atn.getSchema() : null, atn.getTableName(),
                        tc.getDomainObjectName(), tc.getAlias(),
                        isTrue(tc.getProperty(PropertyRegistry.TABLE_IGNORE_QUALIFIERS_AT_RUNTIME)),
                        tc.getProperty(PropertyRegistry.TABLE_RUNTIME_CATALOG),
                        tc.getProperty(PropertyRegistry.TABLE_RUNTIME_SCHEMA),
                        tc.getProperty(PropertyRegistry.TABLE_RUNTIME_TABLE_NAME), delimitIdentifiers, context);

        introspectedTable = ObjectFactory.createIntrospectedTable(tc, table, context);

        for (IntrospectedColumn introspectedColumn : entry.getValue()) {
            introspectedTable.addColumn(introspectedColumn);
        }
        calculatePrimaryKey(table, introspectedTable);
    }

    return introspectedTable;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:37,代码来源:DatabaseIntrospector.java

示例10: getCommentGenerator

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
public CommentGenerator getCommentGenerator() {
    if (commentGenerator == null) {
        commentGenerator = ObjectFactory.createCommentGenerator(this);
    }

    return commentGenerator;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:8,代码来源:Context.java

示例11: getJavaFormatter

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
public JavaFormatter getJavaFormatter() {
    if (javaFormatter == null) {
        javaFormatter = ObjectFactory.createJavaFormatter(this);
    }

    return javaFormatter;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:8,代码来源:Context.java

示例12: getXmlFormatter

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
public XmlFormatter getXmlFormatter() {
    if (xmlFormatter == null) {
        xmlFormatter = ObjectFactory.createXmlFormatter(this);
    }

    return xmlFormatter;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:8,代码来源:Context.java

示例13: generateFiles

import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
public void generateFiles(ProgressCallback callback, List<GeneratedJavaFile> generatedJavaFiles,
        List<GeneratedXmlFile> generatedXmlFiles, List<String> warnings) throws InterruptedException {

    pluginAggregator = new PluginAggregator();
    for (PluginConfiguration pluginConfiguration : pluginConfigurations) {
        Plugin plugin = ObjectFactory.createPlugin(this, pluginConfiguration);
        if (plugin.validate(warnings)) {
            pluginAggregator.addPlugin(plugin);
        } else {
            warnings.add(getString("Warning.24", //$NON-NLS-1$
                    pluginConfiguration.getConfigurationType(), id));
        }
    }

    if (introspectedTables != null) {
        for (IntrospectedTable introspectedTable : introspectedTables) {
            callback.checkCancel();

            introspectedTable.initialize();
            introspectedTable.calculateGenerators();
            generatedJavaFiles.addAll(introspectedTable.getGeneratedJavaFiles());
            generatedXmlFiles.addAll(introspectedTable.getGeneratedXmlFiles());

            generatedJavaFiles.addAll(pluginAggregator.contextGenerateAdditionalJavaFiles(introspectedTable));
            generatedXmlFiles.addAll(pluginAggregator.contextGenerateAdditionalXmlFiles(introspectedTable));
        }
    }

    generatedJavaFiles.addAll(pluginAggregator.contextGenerateAdditionalJavaFiles());
    generatedXmlFiles.addAll(pluginAggregator.contextGenerateAdditionalXmlFiles());
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:32,代码来源:Context.java


注:本文中的org.mybatis.generator.internal.ObjectFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。