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


Java Parameter类代码示例

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


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

示例1: getConstructorClone

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
/**
 * Gets the constructor clone.
 *
 * @param commentGenerator
 *            the comment generator
 * @param type
 *            the type
 * @param introspectedTable
 *            the introspected table
 * @return the constructor clone
 */
public final Method getConstructorClone(CommentGenerator commentGenerator,
        FullyQualifiedJavaType type, IntrospectedTable introspectedTable) {
    configure();
    Method answer = new Method();
    answer.setConstructor(true);
    answer.setName(type.getShortName());
    answer.setVisibility(constructorTemplate.getVisibility());
    for (Parameter parm : constructorTemplate.getParameters()) {
        answer.addParameter(parm);
    }

    for (String bodyLine : constructorTemplate.getBodyLines()) {
        answer.addBodyLine(bodyLine);
    }

    for (FullyQualifiedJavaType fqjt : constructorTemplate.getExceptions()) {
        answer.addException(fqjt);
    }

    commentGenerator.addGeneralMethodComment(answer, introspectedTable);

    return answer;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:35,代码来源:AbstractDAOTemplate.java

示例2: addSetterComment

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
public void addSetterComment(Method method, IntrospectedTable introspectedTable,
        IntrospectedColumn introspectedColumn) {
    if (suppressAllComments) {
        return;
    }
    method.addJavaDocLine("/**");
    StringBuilder sb = new StringBuilder();
    sb.append(" * ");
    sb.append(introspectedColumn.getRemarks());
    method.addJavaDocLine(sb.toString().replace("\n", " "));
    Parameter parm = method.getParameters().get(0);
    sb.setLength(0);
    sb.append(" * @param ");
    sb.append(parm.getName());
    sb.append(" ");
    sb.append(introspectedColumn.getRemarks());
    method.addJavaDocLine(sb.toString().replace("\n", " "));
    method.addJavaDocLine(" */");
}
 
开发者ID:xiachuanshou,项目名称:shop-manager,代码行数:20,代码来源:MyCommentGenerator.java

示例3: getMethodShell

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType type = new FullyQualifiedJavaType(
            introspectedTable.getExampleType());
    importedTypes.add(type);

    Method method = new Method();
    method.setVisibility(getExampleMethodVisibility());
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(getDAOMethodNameCalculator()
            .getDeleteByExampleMethodName(introspectedTable));
    method.addParameter(new Parameter(type, "example")); //$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,代码行数:23,代码来源:DeleteByExampleMethodGenerator.java

示例4: getMethodShell

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType parameterType = new FullyQualifiedJavaType(
            introspectedTable.getBaseRecordType());
    importedTypes.add(parameterType);

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method
            .setName(getDAOMethodNameCalculator()
                    .getUpdateByPrimaryKeyWithoutBLOBsMethodName(
                            introspectedTable));
    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,代码行数:25,代码来源:UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java

示例5: addInterfaceElements

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
@Override
public void addInterfaceElements(Interface interfaze) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(
            introspectedTable.getExampleType());

    Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
    importedTypes.add(fqjt);

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(new FullyQualifiedJavaType("long")); //$NON-NLS-1$
    method.setName(introspectedTable.getCountByExampleStatementId());
    method.addParameter(new Parameter(fqjt, "example")); //$NON-NLS-1$
    context.getCommentGenerator().addGeneralMethodComment(method,
            introspectedTable);

    addMapperAnnotations(method);
    
    if (context.getPlugins().clientCountByExampleMethodGenerated(method,
            interfaze, introspectedTable)) {
        addExtraImports(interfaze);
        interfaze.addImportedTypes(importedTypes);
        interfaze.addMethod(method);
    }
}
 
开发者ID:nextyu,项目名称:summer-mybatis-generator,代码行数:26,代码来源:CountByExampleMethodGenerator.java

示例6: getMethodShell

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType type = new FullyQualifiedJavaType(
            introspectedTable.getExampleType());
    importedTypes.add(type);

    Method method = new Method();
    method.setVisibility(getExampleMethodVisibility());
    method.setReturnType(new FullyQualifiedJavaType("long")); //$NON-NLS-1$
    method.setName(getDAOMethodNameCalculator()
            .getCountByExampleMethodName(introspectedTable));
    method.addParameter(new Parameter(type, "example")); //$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,代码行数:23,代码来源:CountByExampleMethodGenerator.java

示例7: addInterfaceElements

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
@Override
public void addInterfaceElements(Interface interfaze) {
    Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
    FullyQualifiedJavaType type = new FullyQualifiedJavaType(
            introspectedTable.getExampleType());
    importedTypes.add(type);

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(introspectedTable.getDeleteByExampleStatementId());
    method.addParameter(new Parameter(type, "example")); //$NON-NLS-1$

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

    addMapperAnnotations(method);
    
    if (context.getPlugins().clientDeleteByExampleMethodGenerated(
            method, interfaze, introspectedTable)) {
        addExtraImports(interfaze);
        interfaze.addImportedTypes(importedTypes);
        interfaze.addMethod(method);
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:26,代码来源:DeleteByExampleMethodGenerator.java

示例8: addInterfaceElements

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
@Override
public void addInterfaceElements(Interface interfaze) {
    Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
    FullyQualifiedJavaType parameterType = new FullyQualifiedJavaType(
            introspectedTable.getBaseRecordType());
    importedTypes.add(parameterType);

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(introspectedTable.getUpdateByPrimaryKeyStatementId());
    method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$

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

    addMapperAnnotations(method);
    
    if (context.getPlugins()
            .clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated(method,
                    interfaze, introspectedTable)) {
        addExtraImports(interfaze);
        interfaze.addImportedTypes(importedTypes);
        interfaze.addMethod(method);
    }
}
 
开发者ID:nextyu,项目名称:summer-mybatis-generator,代码行数:27,代码来源:UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java

示例9: addParameterizedConstructor

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
private void addParameterizedConstructor(TopLevelClass topLevelClass) {
    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setConstructor(true);
    method.setName(topLevelClass.getType().getShortName());
    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable);
    
    StringBuilder sb = new StringBuilder();
    for (IntrospectedColumn introspectedColumn : introspectedTable
            .getPrimaryKeyColumns()) {
        method.addParameter(new Parameter(introspectedColumn.getFullyQualifiedJavaType(),
                introspectedColumn.getJavaProperty()));
        sb.setLength(0);
        sb.append("this."); //$NON-NLS-1$
        sb.append(introspectedColumn.getJavaProperty());
        sb.append(" = "); //$NON-NLS-1$
        sb.append(introspectedColumn.getJavaProperty());
        sb.append(';');
        method.addBodyLine(sb.toString());
    }
    
    topLevelClass.addMethod(method);
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:24,代码来源:PrimaryKeyGenerator.java

示例10: addInterfaceElements

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
@Override
public void addInterfaceElements(Interface interfaze) {
    Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
    Method method = new Method();

    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName(introspectedTable.getInsertSelectiveStatementId());

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

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

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

    addMapperAnnotations(interfaze, method);
    
    if (context.getPlugins().clientInsertSelectiveMethodGenerated(
            method, interfaze, introspectedTable)) {
        interfaze.addImportedTypes(importedTypes);
        interfaze.addMethod(method);
    }
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:27,代码来源:InsertSelectiveMethodGenerator.java

示例11: addInterfaceElements

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
@Override
public void addInterfaceElements(Interface interfaze) {
    Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
    FullyQualifiedJavaType parameterType = new FullyQualifiedJavaType(
            introspectedTable.getBaseRecordType());
    importedTypes.add(parameterType);

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(introspectedTable.getUpdateByPrimaryKeyStatementId());
    method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$

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

    addMapperAnnotations(interfaze, method);
    
    if (context.getPlugins()
            .clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated(method,
                    interfaze, introspectedTable)) {
        interfaze.addImportedTypes(importedTypes);
        interfaze.addMethod(method);
    }
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:26,代码来源:UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java

示例12: addInterfaceElements

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
@Override
public void addInterfaceElements(Interface interfaze) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(
            introspectedTable.getExampleType());

    Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
    importedTypes.add(fqjt);

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(new FullyQualifiedJavaType("long")); //$NON-NLS-1$
    method.setName(introspectedTable.getCountByExampleStatementId());
    method.addParameter(new Parameter(fqjt, "example")); //$NON-NLS-1$
    context.getCommentGenerator().addGeneralMethodComment(method,
            introspectedTable);

    addMapperAnnotations(interfaze, method);
    
    if (context.getPlugins().clientCountByExampleMethodGenerated(method,
            interfaze, introspectedTable)) {
        interfaze.addImportedTypes(importedTypes);
        interfaze.addMethod(method);
    }
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:25,代码来源:CountByExampleMethodGenerator.java

示例13: addSetterComment

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
    StringBuilder sb = new StringBuilder();
    method.addJavaDocLine("/**");
    if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
        sb.append(" * 设置");
        sb.append(introspectedColumn.getRemarks());
        method.addJavaDocLine(sb.toString());
        method.addJavaDocLine(" *");
    }

    Parameter param = (Parameter)method.getParameters().get(0);
    sb.setLength(0);
    sb.append(" * @param ");
    sb.append(param.getName());
    if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
        sb.append(" ");
        sb.append(introspectedColumn.getRemarks());
    }

    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" */");
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:23,代码来源:MyCommentGenerator.java

示例14: clientDeleteByPrimaryKeyMethodGenerated

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
@Override
public boolean clientDeleteByPrimaryKeyMethodGenerated(Method method,
                                                       Interface interfaze, IntrospectedTable introspectedTable) {
    if (ignore(introspectedTable)) {
        return true;
    }
    Method m = new Method();
    m.setName("deleteByPrimaryKeyWithVersion");
    copyMethod(m, method, introspectedTable.getPrimaryKeyColumns());
    m.addParameter(new Parameter(new FullyQualifiedJavaType("java.lang.Integer"), "version","@Param(\"version\")"));
    m.addException(new FullyQualifiedJavaType(optimisticLockException));

    interfaze.addMethod(m);
    interfaze.addImportedType(new FullyQualifiedJavaType(optimisticLockException));
    return true;
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:17,代码来源:OptimisticLockMethodPlugin.java

示例15: getJavaBeansSetter

import org.mybatis.generator.api.dom.java.Parameter; //导入依赖的package包/类
/**
 * Gets the java beans setter.
 *
 * @param introspectedColumn
 *            the introspected column
 * @param context
 *            the context
 * @param introspectedTable
 *            the introspected table
 * @return the java beans setter
 */
public static Method getJavaBeansSetter(IntrospectedColumn introspectedColumn,
        Context context,
        IntrospectedTable introspectedTable) {
    FullyQualifiedJavaType fqjt = introspectedColumn
            .getFullyQualifiedJavaType();
    String property = introspectedColumn.getJavaProperty();

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName(getSetterMethodName(property));
    method.addParameter(new Parameter(fqjt, property));
    context.getCommentGenerator().addSetterComment(method,
            introspectedTable, introspectedColumn);

    StringBuilder sb = new StringBuilder();
    if (introspectedColumn.isStringColumn() && isTrimStringsEnabled(introspectedColumn)) {
        sb.append("this."); //$NON-NLS-1$
        sb.append(property);
        sb.append(" = "); //$NON-NLS-1$
        sb.append(property);
        sb.append(" == null ? null : "); //$NON-NLS-1$
        sb.append(property);
        sb.append(".trim();"); //$NON-NLS-1$
        method.addBodyLine(sb.toString());
    } else {
        sb.append("this."); //$NON-NLS-1$
        sb.append(property);
        sb.append(" = "); //$NON-NLS-1$
        sb.append(property);
        sb.append(';');
        method.addBodyLine(sb.toString());
    }

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


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