本文整理汇总了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());
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}