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


Java DAOMethodNameCalculator类代码示例

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


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

示例1: getMethodShell

import org.mybatis.generator.api.DAOMethodNameCalculator; //导入依赖的package包/类
private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
	Method method = new Method();

	FullyQualifiedJavaType returnType;
	if (introspectedTable.getGeneratedKey() != null) {
		IntrospectedColumn introspectedColumn = introspectedTable.getColumn(introspectedTable.getGeneratedKey()
				.getColumn());
		if (introspectedColumn == null) {
			// the specified column doesn't exist, so don't do the generated
			// key
			// (the warning has already been reported)
			returnType = null;
		} else {
			returnType = introspectedColumn.getFullyQualifiedJavaType();
			importedTypes.add(returnType);
		}
	} else {
		returnType = null;
	}

	method.setReturnType(returnType);
	method.setVisibility(JavaVisibility.PUBLIC);
	DAOMethodNameCalculator methodNameCalculator = getDAOMethodNameCalculator();
	method.setName(methodNameCalculator.getInsertMethodName(introspectedTable));

	FullyQualifiedJavaType parameterType = introspectedTable.getRules().calculateAllFieldsClass();

	importedTypes.add(parameterType);
	method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$

	for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) {
		method.addException(fqjt);
		importedTypes.add(fqjt);
	}

	context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable);

	return method;
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:40,代码来源:InsertMethodGenerator.java

示例2: getMethodShell

import org.mybatis.generator.api.DAOMethodNameCalculator; //导入依赖的package包/类
private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    Method method = new Method();

    FullyQualifiedJavaType returnType;
    if (introspectedTable.getGeneratedKey() != null) {
        IntrospectedColumn introspectedColumn = introspectedTable
                .getColumn(introspectedTable.getGeneratedKey().getColumn());
        if (introspectedColumn == null) {
            // the specified column doesn't exist, so don't do the generated
            // key
            // (the warning has already been reported)
            returnType = null;
        } else {
            returnType = introspectedColumn.getFullyQualifiedJavaType();
            importedTypes.add(returnType);
        }
    } else {
        returnType = null;
    }

    method.setReturnType(returnType);
    method.setVisibility(JavaVisibility.PUBLIC);
    DAOMethodNameCalculator methodNameCalculator = getDAOMethodNameCalculator();
    method.setName(methodNameCalculator
            .getInsertMethodName(introspectedTable));

    FullyQualifiedJavaType parameterType = introspectedTable.getRules()
            .calculateAllFieldsClass();

    importedTypes.add(parameterType);
    method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$

    for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) {
        method.addException(fqjt);
        importedTypes.add(fqjt);
    }

    context.getCommentGenerator().addGeneralMethodComment(method,
            introspectedTable);

    return method;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:43,代码来源:InsertMethodGenerator.java


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