本文整理汇总了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$
}
}
示例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$
}
}
示例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;
}
示例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$
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: getCommentGenerator
import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
public CommentGenerator getCommentGenerator() {
if (commentGenerator == null) {
commentGenerator = ObjectFactory.createCommentGenerator(this);
}
return commentGenerator;
}
示例11: getJavaFormatter
import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
public JavaFormatter getJavaFormatter() {
if (javaFormatter == null) {
javaFormatter = ObjectFactory.createJavaFormatter(this);
}
return javaFormatter;
}
示例12: getXmlFormatter
import org.mybatis.generator.internal.ObjectFactory; //导入依赖的package包/类
public XmlFormatter getXmlFormatter() {
if (xmlFormatter == null) {
xmlFormatter = ObjectFactory.createXmlFormatter(this);
}
return xmlFormatter;
}
示例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());
}