本文整理汇总了Java中org.mybatis.generator.config.SqlMapGeneratorConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java SqlMapGeneratorConfiguration类的具体用法?Java SqlMapGeneratorConfiguration怎么用?Java SqlMapGeneratorConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SqlMapGeneratorConfiguration类属于org.mybatis.generator.config包,在下文中一共展示了SqlMapGeneratorConfiguration类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateSqlMapPackage
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
/**
* Calculate sql map package.
*
* @return the string
*/
protected String calculateSqlMapPackage() {
StringBuilder sb = new StringBuilder();
SqlMapGeneratorConfiguration config = context
.getSqlMapGeneratorConfiguration();
// config can be null if the Java client does not require XML
if (config != null) {
sb.append(config.getTargetPackage());
sb.append(fullyQualifiedTable.getSubPackageForClientOrSqlMap(isSubPackagesEnabled(config)));
if (stringHasValue(tableConfiguration.getMapperName())) {
String mapperName = tableConfiguration.getMapperName();
int ind = mapperName.lastIndexOf('.');
if (ind != -1) {
sb.append('.').append(mapperName.substring(0, ind));
}
}
}
return sb.toString();
}
示例2: parseSqlMapGenerator
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
protected void parseSqlMapGenerator(Context context, Node node) {
SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration = new SqlMapGeneratorConfiguration();
context.setSqlMapGeneratorConfiguration(sqlMapGeneratorConfiguration);
Properties attributes = parseAttributes(node);
String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$
sqlMapGeneratorConfiguration.setTargetPackage(targetPackage);
sqlMapGeneratorConfiguration.setTargetProject(targetProject);
NodeList nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node childNode = nodeList.item(i);
if (childNode.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
parseProperty(sqlMapGeneratorConfiguration, childNode);
}
}
}
示例3: parseSqlMapGenerator
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
private void parseSqlMapGenerator(Context context, Node node) {
SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration = new SqlMapGeneratorConfiguration();
context.setSqlMapGeneratorConfiguration(sqlMapGeneratorConfiguration);
Properties attributes = parseAttributes(node);
String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$
sqlMapGeneratorConfiguration.setTargetPackage(targetPackage);
sqlMapGeneratorConfiguration.setTargetProject(targetProject);
NodeList nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node childNode = nodeList.item(i);
if (childNode.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
parseProperty(sqlMapGeneratorConfiguration, childNode);
}
}
}
示例4: parseSqlMapGenerator
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
private void parseSqlMapGenerator(Context context, Node node) {
SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration = new SqlMapGeneratorConfiguration();
context.setSqlMapGeneratorConfiguration(sqlMapGeneratorConfiguration);
Properties attributes = parseAttributes(node);
String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$
sqlMapGeneratorConfiguration.setTargetPackage(targetPackage);
sqlMapGeneratorConfiguration.setTargetProject(targetProject);
NodeList nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node childNode = nodeList.item(i);
if (childNode.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
parseProperty(sqlMapGeneratorConfiguration, childNode);
}
}
}
示例5: calculateSqlMapPackage
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
/**
* Calculate sql map package.
*
* @return the string
*/
protected String calculateSqlMapPackage() {
StringBuilder sb = new StringBuilder();
SqlMapGeneratorConfiguration config = context
.getSqlMapGeneratorConfiguration();
// config can be null if the Java client does not require XML
if (config != null) {
sb.append(config.getTargetPackage());
sb.append(fullyQualifiedTable.getSubPackage(isSubPackagesEnabled(config)));
}
return sb.toString();
}
示例6: calculateSqlMapPackage
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
protected String calculateSqlMapPackage() {
StringBuilder sb = new StringBuilder();
SqlMapGeneratorConfiguration config = context
.getSqlMapGeneratorConfiguration();
// config can be null if the Java client does not require XML
if (config != null) {
sb.append(config.getTargetPackage());
sb.append(fullyQualifiedTable.getSubPackage(isSubPackagesEnabled(config)));
}
return sb.toString();
}
示例7: sqlMapGenerated
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
@Override
public boolean sqlMapGenerated(GeneratedXmlFile sqlMap, IntrospectedTable introspectedTable) {
SqlMapGeneratorConfiguration smgc = context.getSqlMapGeneratorConfiguration();
try {
Document document = (Document) FieldUtils.readDeclaredField(sqlMap, "document", true);
File targetFile = getTargetFile(smgc.getTargetPackage(), sqlMap.getFileName());
if (!targetFile.exists()) { // 第一次生成直接使用当前生成的文件
return true;
}
visitAndMerge(document, targetFile);
} catch (ShellException | IOException | IllegalAccessException | DocumentException e) {
e.printStackTrace();
}
return true;
}
示例8: calculateIbatis2SqlMapPackage
import org.mybatis.generator.config.SqlMapGeneratorConfiguration; //导入依赖的package包/类
protected String calculateIbatis2SqlMapPackage() {
StringBuilder sb = new StringBuilder();
SqlMapGeneratorConfiguration config = context.getSqlMapGeneratorConfiguration();
// config can be null if the Java client does not require XML
if (config != null) {
sb.append(config.getTargetPackage());
if (isTrue(config.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) {
sb.append(fullyQualifiedTable.getSubPackage());
}
}
return sb.toString();
}