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


Java JavaModelGeneratorConfiguration类代码示例

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


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

示例1: parseJavaModelGenerator

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
protected void parseJavaModelGenerator(Context context, Node node) {
    JavaModelGeneratorConfiguration javaModelGeneratorConfiguration = new JavaModelGeneratorConfiguration();

    context
            .setJavaModelGeneratorConfiguration(javaModelGeneratorConfiguration);

    Properties attributes = parseAttributes(node);
    String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
    String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$

    javaModelGeneratorConfiguration.setTargetPackage(targetPackage);
    javaModelGeneratorConfiguration.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(javaModelGeneratorConfiguration, childNode);
        }
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:27,代码来源:MyBatisGeneratorConfigurationParser.java

示例2: parseJavaModelGenerator

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
private void parseJavaModelGenerator(Context context, Node node) {
    JavaModelGeneratorConfiguration javaModelGeneratorConfiguration = new JavaModelGeneratorConfiguration();

    context
            .setJavaModelGeneratorConfiguration(javaModelGeneratorConfiguration);

    Properties attributes = parseAttributes(node);
    String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
    String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$

    javaModelGeneratorConfiguration.setTargetPackage(targetPackage);
    javaModelGeneratorConfiguration.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(javaModelGeneratorConfiguration, childNode);
        }
    }
}
 
开发者ID:backkoms,项目名称:mybatis-generator-comments,代码行数:27,代码来源:IbatorConfigurationParser.java

示例3: parseJavaModelGenerator

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
private void parseJavaModelGenerator(Context context, Node node) {
	JavaModelGeneratorConfiguration javaModelGeneratorConfiguration = new JavaModelGeneratorConfiguration();

	context.setJavaModelGeneratorConfiguration(javaModelGeneratorConfiguration);

	Properties attributes = parseAttributes(node);
	String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
	String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$

	javaModelGeneratorConfiguration.setTargetPackage(targetPackage);
	javaModelGeneratorConfiguration.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(javaModelGeneratorConfiguration, childNode);
		}
	}
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:26,代码来源:IbatorConfigurationParser.java

示例4: calculateJavaModelPackage

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
/**
 * Calculate java model package.
 *
 * @return the string
 */
protected String calculateJavaModelPackage() {
    JavaModelGeneratorConfiguration config = context
            .getJavaModelGeneratorConfiguration();

    StringBuilder sb = new StringBuilder();
    sb.append(config.getTargetPackage());
    sb.append(fullyQualifiedTable.getSubPackageForModel(isSubPackagesEnabled(config)));

    return sb.toString();
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:16,代码来源:IntrospectedTable.java

示例5: initialized

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
/**
 * 初始化阶段
 * 具体执行顺序 http://www.mybatis.org/generator/reference/pluggingIn.html
 *
 * @param introspectedTable
 */
@Override
public void initialized(IntrospectedTable introspectedTable) {
    String exampleType = introspectedTable.getExampleType();
    // 修改包名
    Context context = getContext();
    JavaModelGeneratorConfiguration configuration = context.getJavaModelGeneratorConfiguration();
    String targetPackage = configuration.getTargetPackage();
    String newExampleType = exampleType.replace(targetPackage, this.targetPackage);

    introspectedTable.setExampleType(newExampleType);

    logger.debug("itfsw(Example 目标包修改插件):修改"+introspectedTable.getExampleType()+"的包到"+this.targetPackage);
}
 
开发者ID:itfsw,项目名称:mybatis-generator-plugin,代码行数:20,代码来源:ExampleTargetPlugin.java

示例6: setDomainObjectName

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
/**
 * 设置DomainObjectName和MapperName
 *
 * @param introspectedTable
 * @param context
 * @param domainObjectName
 */
public static void setDomainObjectName(IntrospectedTable introspectedTable, Context context, String domainObjectName) throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    // 配置信息(没啥用)
    introspectedTable.getTableConfiguration().setDomainObjectName(domainObjectName);

    // FullyQualifiedTable修正
    Field domainObjectNameField = FullyQualifiedTable.class.getDeclaredField("domainObjectName");
    domainObjectNameField.setAccessible(true);
    domainObjectNameField.set(introspectedTable.getFullyQualifiedTable(), domainObjectName);

    // 重新修正introspectedTable属性信息
    Method calculateJavaClientAttributes = IntrospectedTable.class.getDeclaredMethod("calculateJavaClientAttributes");
    calculateJavaClientAttributes.setAccessible(true);
    calculateJavaClientAttributes.invoke(introspectedTable);

    Method calculateModelAttributes = IntrospectedTable.class.getDeclaredMethod("calculateModelAttributes");
    calculateModelAttributes.setAccessible(true);
    calculateModelAttributes.invoke(introspectedTable);

    Method calculateXmlAttributes = IntrospectedTable.class.getDeclaredMethod("calculateXmlAttributes");
    calculateXmlAttributes.setAccessible(true);
    calculateXmlAttributes.invoke(introspectedTable);

    // 注意!! 如果配置了ExampleTargetPlugin插件,要修正Example 位置
    PluginConfiguration configuration = PluginTools.getPluginConfiguration(context, ExampleTargetPlugin.class);
    if (configuration != null && configuration.getProperty(ExampleTargetPlugin.PRO_TARGET_PACKAGE) != null) {
        String exampleType = introspectedTable.getExampleType();
        // 修改包名
        JavaModelGeneratorConfiguration javaModelGeneratorConfiguration = context.getJavaModelGeneratorConfiguration();
        String targetPackage = javaModelGeneratorConfiguration.getTargetPackage();
        String newExampleType = exampleType.replace(targetPackage, configuration.getProperty(ExampleTargetPlugin.PRO_TARGET_PACKAGE));

        introspectedTable.setExampleType(newExampleType);
    }
}
 
开发者ID:itfsw,项目名称:mybatis-generator-plugin,代码行数:42,代码来源:IntrospectedTableTools.java

示例7: calculateJavaModelPackage

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
/**
 * Calculate java model package.
 *
 * @return the string
 */
protected String calculateJavaModelPackage() {
    JavaModelGeneratorConfiguration config = context
            .getJavaModelGeneratorConfiguration();

    StringBuilder sb = new StringBuilder();
    sb.append(config.getTargetPackage());
    sb.append(fullyQualifiedTable.getSubPackage(isSubPackagesEnabled(config)));

    return sb.toString();
}
 
开发者ID:backkoms,项目名称:mybatis-generator-comments,代码行数:16,代码来源:IntrospectedTable.java

示例8: calculateJavaModelPackage

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
protected String calculateJavaModelPackage() {
    JavaModelGeneratorConfiguration config = context
            .getJavaModelGeneratorConfiguration();

    StringBuilder sb = new StringBuilder();
    sb.append(config.getTargetPackage());
    sb.append(fullyQualifiedTable.getSubPackage(isSubPackagesEnabled(config)));

    return sb.toString();
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:11,代码来源:IntrospectedTable.java

示例9: calculateJavaModelPackage

import org.mybatis.generator.config.JavaModelGeneratorConfiguration; //导入依赖的package包/类
protected String calculateJavaModelPackage() {
	JavaModelGeneratorConfiguration config = context.getJavaModelGeneratorConfiguration();

	StringBuilder sb = new StringBuilder();
	sb.append(config.getTargetPackage());
	if (isTrue(config.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) {
		sb.append(fullyQualifiedTable.getSubPackage());
	}

	return sb.toString();
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:12,代码来源:IntrospectedTable.java


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