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


Java JavaTypeResolver类代码示例

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


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

示例1: DatabaseIntrospector

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Instantiates a new database introspector.
 *
 * @param context
 *            the context
 * @param databaseMetaData
 *            the database meta data
 * @param javaTypeResolver
 *            the java type resolver
 * @param warnings
 *            the warnings
 */
public DatabaseIntrospector(Context context,
        DatabaseMetaData databaseMetaData,
        JavaTypeResolver javaTypeResolver, List<String> warnings) {
    super();
    this.context = context;
    this.databaseMetaData = databaseMetaData;
    this.javaTypeResolver = javaTypeResolver;
    this.warnings = warnings;
    logger = LogFactory.getLog(getClass());
    
    //获取数据库的版本信息
    try {
        DatabaseMetaData md = databaseMetaData.getConnection().getMetaData();
        databaseProductName = md.getDatabaseProductName().toUpperCase();
    } catch (SQLException se) {
        warnings.add("获取数据库版本失败:" + se.getMessage());
    }
}
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:31,代码来源:DatabaseIntrospector.java

示例2: createJavaTypeResolver

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
public static JavaTypeResolver createJavaTypeResolver(Context context) {
    JavaTypeResolverConfiguration config = context
            .getJavaTypeResolverConfiguration();
    String type;

    if (config != null && config.getConfigurationType() != null) {
        type = config.getConfigurationType();
        if ("DEFAULT".equalsIgnoreCase(type)) { //$NON-NLS-1$
            type = JavaTypeResolverDefaultImpl.class.getName();
        }
    } else {
        type = JavaTypeResolverDefaultImpl.class.getName();
    }

    JavaTypeResolver answer = (JavaTypeResolver) createInternalObject(type);

    if (config != null) {
        answer.addConfigurationProperties(config.getProperties());
    }

    answer.setContext(context);

    return answer;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:25,代码来源:ObjectFactory.java

示例3: getIntrospectedTables

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的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: createJavaTypeResolver

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
public static JavaTypeResolver createJavaTypeResolver(Context context,
        List<String> warnings) {
    JavaTypeResolverConfiguration config = context
            .getJavaTypeResolverConfiguration();
    String type;

    if (config != null && config.getConfigurationType() != null) {
        type = config.getConfigurationType();
        if ("DEFAULT".equalsIgnoreCase(type)) { //$NON-NLS-1$
            type = JavaTypeResolverDefaultImpl.class.getName();
        }
    } else {
        type = JavaTypeResolverDefaultImpl.class.getName();
    }

    JavaTypeResolver answer = (JavaTypeResolver) createInternalObject(type);
    answer.setWarnings(warnings);

    if (config != null) {
        answer.addConfigurationProperties(config.getProperties());
    }

    answer.setContext(context);

    return answer;
}
 
开发者ID:handosme,项目名称:mybatis-generator-plus,代码行数:27,代码来源:ObjectFactory.java

示例5: createJavaTypeResolver

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
public static JavaTypeResolver createJavaTypeResolver(Context context, List<String> warnings) {
	JavaTypeResolverConfiguration config = context.getJavaTypeResolverConfiguration();
	String type;

	if (config != null && config.getConfigurationType() != null) {
		type = config.getConfigurationType();
		if ("DEFAULT".equalsIgnoreCase(type)) { //$NON-NLS-1$
			type = JavaTypeResolverDefaultImpl.class.getName();
		}
	} else {
		type = JavaTypeResolverDefaultImpl.class.getName();
	}

	JavaTypeResolver answer = (JavaTypeResolver) createInternalObject(type);
	answer.setWarnings(warnings);

	if (config != null) {
		answer.addConfigurationProperties(config.getProperties());
	}

	answer.setContext(context);

	return answer;
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:25,代码来源:ObjectFactory.java

示例6: createJavaTypeResolver

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Creates a new Object object.
 *
 * @param context
 *            the context
 * @param warnings
 *            the warnings
 * @return the java type resolver
 */
public static JavaTypeResolver createJavaTypeResolver(Context context,
        List<String> warnings) {
    JavaTypeResolverConfiguration config = context
            .getJavaTypeResolverConfiguration();
    String type;

    if (config != null && config.getConfigurationType() != null) {
        type = config.getConfigurationType();
        if ("DEFAULT".equalsIgnoreCase(type)) { //$NON-NLS-1$
            type = JavaTypeResolverDefaultImpl.class.getName();
        }
    } else {
        type = JavaTypeResolverDefaultImpl.class.getName();
    }

    JavaTypeResolver answer = (JavaTypeResolver) createInternalObject(type);
    answer.setWarnings(warnings);

    if (config != null) {
        answer.addConfigurationProperties(config.getProperties());
    }

    answer.setContext(context);

    return answer;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:36,代码来源:ObjectFactory.java

示例7: DatabaseIntrospector

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
public DatabaseIntrospector(Context context,
        DatabaseMetaData databaseMetaData,
        JavaTypeResolver javaTypeResolver, List<String> warnings) {
    super();
    this.context = context;
    this.databaseMetaData = databaseMetaData;
    this.javaTypeResolver = javaTypeResolver;
    this.warnings = warnings;
    logger = LogFactory.getLog(getClass());
}
 
开发者ID:handosme,项目名称:mybatis-generator-plus,代码行数:11,代码来源:DatabaseIntrospector.java

示例8: DatabaseIntrospector

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
public DatabaseIntrospector(Context context, DatabaseMetaData databaseMetaData, JavaTypeResolver javaTypeResolver,
		List<String> warnings) throws SQLException {
	super();
	this.context = context;
	this.databaseMetaData = databaseMetaData;
	this.javaTypeResolver = javaTypeResolver;
	this.warnings = warnings;
	this.connection= this.context.getConnection();
	logger = LogFactory.getLog(getClass());
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:11,代码来源:DatabaseIntrospector.java

示例9: introspectTables

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback,
        List<String> warnings, Set<String> fullyQualifiedTableNames)
        throws SQLException, InterruptedException {

    introspectedTables = new ArrayList<IntrospectedTable>();
    JavaTypeResolver javaTypeResolver = ObjectFactory
            .createJavaTypeResolver(this, warnings);

    Connection connection = null;

    try {
        callback.startTask(getString("Progress.0")); //$NON-NLS-1$
        connection = getConnection();

        DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(
                this, connection.getMetaData(), javaTypeResolver, warnings);

        for (TableConfiguration tc : tableConfigurations) {
            String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc
                            .getSchema(), tc.getTableName(), '.');

            if (fullyQualifiedTableNames != null
                    && fullyQualifiedTableNames.size() > 0
                    && !fullyQualifiedTableNames.contains(tableName)) {
                continue;
            }

            if (!tc.areAnyStatementsEnabled()) {
                warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
                continue;
            }

            callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
            List<IntrospectedTable> tables = databaseIntrospector
                    .introspectTables(tc);

            if (tables != null) {
                introspectedTables.addAll(tables);
            }

            callback.checkCancel();
        }
    } finally {
        closeConnection(connection);
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:71,代码来源:Context.java

示例10: introspectTables

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback,
        List<String> warnings, Set<String> fullyQualifiedTableNames)
        throws SQLException, InterruptedException {

    introspectedTables = new ArrayList<IntrospectedTable>();
    JavaTypeResolver javaTypeResolver = ObjectFactory
            .createJavaTypeResolver(this, warnings);

    Connection connection = null;

    try {
        callback.startTask(getString("Progress.0")); //$NON-NLS-1$
        connection = getConnection();

        DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(
                this, connection.getMetaData(), javaTypeResolver, warnings);

        for (TableConfiguration tc : tableConfigurations) {
            String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc
                            .getSchema(), tc.getTableName(), '.');

            if (fullyQualifiedTableNames != null
                    && fullyQualifiedTableNames.size() > 0) {
                if (!fullyQualifiedTableNames.contains(tableName)) {
                    continue;
                }
            }

            if (!tc.areAnyStatementsEnabled()) {
                warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
                continue;
            }

            callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
            List<IntrospectedTable> tables = databaseIntrospector
                    .introspectTables(tc);

            if (tables != null) {
                introspectedTables.addAll(tables);
            }

            callback.checkCancel();
        }
    } finally {
        closeConnection(connection);
    }
}
 
开发者ID:backkoms,项目名称:mybatis-generator-comments,代码行数:72,代码来源:Context.java

示例11: DatabaseIntrospector

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
public DatabaseIntrospector(Context context, DatabaseMetaData databaseMetaData, JavaTypeResolver javaTypeResolver) {
    super();
    this.context = context;
    this.databaseMetaData = databaseMetaData;
    this.javaTypeResolver = javaTypeResolver;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:7,代码来源:DatabaseIntrospector.java

示例12: introspectTables

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the constructor. This method is long running.
 * 
 * @param callback a progress callback if progress information is desired, or <code>null</code>
 * @param warnings any warning generated from this method will be added to the List. Warnings are always Strings.
 * @param fullyQualifiedTableNames a set of table names to generate. The elements of the set must be Strings that
 *            exactly match what's specified in the configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If the Set is null or empty, then all tables
 *            in the configuration will be used for code generation.
 * 
 * @throws SQLException if some error arises while introspecting the specified database tables.
 * @throws InterruptedException if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames)
        throws SQLException, InterruptedException {

    introspectedTables = new ArrayList<IntrospectedTable>();
    JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(this);

    Connection connection = null;

    try {
        callback.startTask(getString("Progress.0")); //$NON-NLS-1$
        connection = getConnection();

        DatabaseIntrospector databaseIntrospector =
                new DatabaseIntrospector(this, connection.getMetaData(), javaTypeResolver);

        for (TableConfiguration tc : tableConfigurations) {
            String tableName =
                    composeFullyQualifiedTableName(tc.getCatalog(), tc.getSchema(), tc.getTableName(), '.');

            if (fullyQualifiedTableNames != null && fullyQualifiedTableNames.size() > 0) {
                if (!fullyQualifiedTableNames.contains(tableName)) {
                    continue;
                }
            }

            if (!tc.areAnyStatementsEnabled()) {
                warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
                continue;
            }

            callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
            IntrospectedTable tables = databaseIntrospector.introspectTables(tc);

            if (tables != null) {
                introspectedTables.add(tables);
            }

            callback.checkCancel();
        }
    } finally {
        closeConnection(connection);
    }
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:57,代码来源:Context.java

示例13: introspectTables

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames) throws SQLException, InterruptedException {

	introspectedTables = new ArrayList<IntrospectedTable>();
	JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(this, warnings);

	Connection connection = null;

	try {
		callback.startTask(getString("Progress.0")); //$NON-NLS-1$
		connection = getConnection();

		DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(this, connection.getMetaData(), javaTypeResolver, warnings);

		for (TableConfiguration tc : tableConfigurations) {
			String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc.getSchema(), tc.getTableName(), '.');

			if (fullyQualifiedTableNames != null && fullyQualifiedTableNames.size() > 0) {
				if (!fullyQualifiedTableNames.contains(tableName)) {
					continue;
				}
			}

			if (!tc.areAnyStatementsEnabled()) {
				warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
				continue;
			}

			callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
			List<IntrospectedTable> tables = databaseIntrospector.introspectTables(tc);

			if (tables != null) {
				introspectedTables.addAll(tables);
			}

			callback.checkCancel();
		}
	}
	finally {
		closeConnection(connection);
	}
}
 
开发者ID:handosme,项目名称:mybatis-generator-plus,代码行数:66,代码来源:Context.java

示例14: introspectTables

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames)
		throws SQLException, InterruptedException {

	introspectedTables = new ArrayList<IntrospectedTable>();
	JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(this, warnings);

	Connection connection = null;

	try {
		callback.startTask(getString("Progress.0")); //$NON-NLS-1$
		connection = getConnection();

		DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(this, connection.getMetaData(),
				javaTypeResolver, warnings);

		for (TableConfiguration tc : tableConfigurations) {
			String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc.getSchema(), tc.getTableName(),
					'.');

			if (fullyQualifiedTableNames != null && fullyQualifiedTableNames.size() > 0) {
				if (!fullyQualifiedTableNames.contains(tableName)) {
					continue;
				}
			}

			if (!tc.areAnyStatementsEnabled()) {
				warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
				continue;
			}

			callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
			List<IntrospectedTable> tables = databaseIntrospector.introspectTables(tc);

			if (tables != null) {
				introspectedTables.addAll(tables);
			}

			callback.checkCancel();
		}
	} finally {
		closeConnection(connection);
	}
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:68,代码来源:Context.java

示例15: DatabaseIntrospector

import org.mybatis.generator.api.JavaTypeResolver; //导入依赖的package包/类
/**
 * Instantiates a new database introspector.
 *
 * @param context
 *            the context
 * @param databaseMetaData
 *            the database meta data
 * @param javaTypeResolver
 *            the java type resolver
 * @param warnings
 *            the warnings
 */
public DatabaseIntrospector(Context context,
        DatabaseMetaData databaseMetaData,
        JavaTypeResolver javaTypeResolver, List<String> warnings) {
    super();
    this.context = context;
    this.databaseMetaData = databaseMetaData;
    this.javaTypeResolver = javaTypeResolver;
    this.warnings = warnings;
    logger = LogFactory.getLog(getClass());
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:23,代码来源:DatabaseIntrospector.java


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