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


Java FullyQualifiedJavaType类代码示例

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


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

示例1: getGetterMethodName

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的package包/类
/**
 * JavaBeans rules:
 * 
 * eMail > geteMail() firstName > getFirstName() URL $gt; getURL() XAxis > getXAxis() a > getA() B >
 * invalid - this method assumes that this is not the case. Call getValidPropertyName first. Yaxis > invalid -
 * this method assumes that this is not the case. Call getValidPropertyName first.
 *
 * @param property
 *            the property
 * @param fullyQualifiedJavaType
 *            the fully qualified java type
 * @return the getter method name
 */
public static String getGetterMethodName(String property,
        FullyQualifiedJavaType fullyQualifiedJavaType) {
    StringBuilder sb = new StringBuilder();

    sb.append(property);
    if (Character.isLowerCase(sb.charAt(0))) {
        if (sb.length() == 1 || !Character.isUpperCase(sb.charAt(1))) {
            sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
        }
    }

    if (fullyQualifiedJavaType.equals(FullyQualifiedJavaType
            .getBooleanPrimitiveInstance())) {
        sb.insert(0, "is"); //$NON-NLS-1$
    } else {
        sb.insert(0, "get"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:34,代码来源:JavaBeansUtil.java

示例2: clientDeleteByPrimaryKeyMethodGenerated

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的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

示例3: addImplementationElements

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

    StringBuilder sb = new StringBuilder();
    sb.append("int rows = "); //$NON-NLS-1$
    sb.append(daoTemplate.getUpdateMethod(introspectedTable
            .getIbatis2SqlMapNamespace(), introspectedTable
            .getUpdateByPrimaryKeyStatementId(), "record")); //$NON-NLS-1$
    method.addBodyLine(sb.toString());

    method.addBodyLine("return rows;"); //$NON-NLS-1$

    if (context.getPlugins()
            .clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated(method,
                    topLevelClass, introspectedTable)) {
        topLevelClass.addImportedTypes(importedTypes);
        topLevelClass.addMethod(method);
    }
}
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:22,代码来源:UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java

示例4: testGenericType3

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的package包/类
@Test
public void testGenericType3() {
    FullyQualifiedJavaType listOfStrings = new FullyQualifiedJavaType("java.util.List"); //$NON-NLS-1$
    listOfStrings.addTypeArgument(new FullyQualifiedJavaType("java.lang.String")); //$NON-NLS-1$

    FullyQualifiedJavaType fqjt =
        new FullyQualifiedJavaType("java.util.Map"); //$NON-NLS-1$
    fqjt.addTypeArgument(new FullyQualifiedJavaType("java.lang.String")); //$NON-NLS-1$
    fqjt.addTypeArgument(listOfStrings);

    assertTrue(fqjt.isExplicitlyImported());
    assertEquals("Map<String, List<String>>", fqjt.getShortName()); //$NON-NLS-1$
    assertEquals("java.util.Map<java.lang.String, java.util.List<java.lang.String>>", fqjt.getFullyQualifiedName()); //$NON-NLS-1$
    assertEquals("java.util", fqjt.getPackageName()); //$NON-NLS-1$
    assertEquals(2, fqjt.getImportList().size());
    assertEquals("java.util.Map", fqjt.getFullyQualifiedNameWithoutTypeParameters()); //$NON-NLS-1$
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:18,代码来源:FullyQualifiedJavaTypeTest.java

示例5: addInterfaceElements

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的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,项目名称:server-utility,代码行数:26,代码来源:UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java

示例6: addImplementationElements

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

    StringBuilder sb = new StringBuilder();
    sb.append("int rows = "); //$NON-NLS-1$
    sb.append(daoTemplate.getUpdateMethod(introspectedTable
            .getIbatis2SqlMapNamespace(), introspectedTable
            .getUpdateByPrimaryKeyWithBLOBsStatementId(), "record")); //$NON-NLS-1$
    method.addBodyLine(sb.toString());

    method.addBodyLine("return rows;"); //$NON-NLS-1$

    if (context.getPlugins()
            .clientUpdateByPrimaryKeyWithBLOBsMethodGenerated(method,
                    topLevelClass, introspectedTable)) {
        topLevelClass.addImportedTypes(importedTypes);
        topLevelClass.addMethod(method);
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:22,代码来源:UpdateByPrimaryKeyWithBLOBsMethodGenerator.java

示例7: addImplementationElements

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

    method
            .addBodyLine("UpdateByExampleParms parms = new UpdateByExampleParms(record, example);"); //$NON-NLS-1$

    StringBuilder sb = new StringBuilder();

    sb.append("int rows = "); //$NON-NLS-1$

    sb.append(daoTemplate.getUpdateMethod(introspectedTable
            .getIbatis2SqlMapNamespace(), introspectedTable
            .getUpdateByExampleSelectiveStatementId(), "parms")); //$NON-NLS-1$
    method.addBodyLine(sb.toString());

    method.addBodyLine("return rows;"); //$NON-NLS-1$

    if (context.getPlugins()
            .clientUpdateByExampleSelectiveMethodGenerated(method,
                    topLevelClass, introspectedTable)) {
        topLevelClass.addImportedTypes(importedTypes);
        topLevelClass.addMethod(method);
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:27,代码来源:UpdateByExampleSelectiveMethodGenerator.java

示例8: addImplementationElements

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

    if (generateForJava5) {
        method.addSuppressTypeWarningsAnnotation();
    }

    StringBuilder sb = new StringBuilder();
    sb.append(method.getReturnType().getShortName());
    sb.append(" list = "); //$NON-NLS-1$
    sb.append(daoTemplate.getQueryForListMethod(introspectedTable
            .getIbatis2SqlMapNamespace(), introspectedTable
            .getSelectByExampleWithBLOBsStatementId(), "example")); //$NON-NLS-1$
    method.addBodyLine(sb.toString());
    method.addBodyLine("return list;"); //$NON-NLS-1$

    if (context.getPlugins()
            .clientSelectByExampleWithBLOBsMethodGenerated(method,
                    topLevelClass, introspectedTable)) {
        topLevelClass.addImportedTypes(importedTypes);
        topLevelClass.addMethod(method);
    }
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:26,代码来源:SelectByExampleWithBLOBsMethodGenerator.java

示例9: addInterfaceElements

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的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:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:26,代码来源:CountByExampleMethodGenerator.java

示例10: getConstructorClone

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的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:DomKing,项目名称:springbootWeb,代码行数:35,代码来源:AbstractDAOTemplate.java

示例11: addImplementationElements

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

    if (generateForJava5) {
        method.addSuppressTypeWarningsAnnotation();
    }

    StringBuilder sb = new StringBuilder();
    sb.append(method.getReturnType().getShortName());
    sb.append(" list = "); //$NON-NLS-1$
    sb.append(daoTemplate.getQueryForListMethod(introspectedTable
            .getIbatis2SqlMapNamespace(), introspectedTable
            .getSelectByExampleStatementId(), "example")); //$NON-NLS-1$
    method.addBodyLine(sb.toString());
    method.addBodyLine("return list;"); //$NON-NLS-1$

    if (context.getPlugins()
            .clientSelectByExampleWithoutBLOBsMethodGenerated(method,
                    topLevelClass, introspectedTable)) {
        topLevelClass.addImportedTypes(importedTypes);
        topLevelClass.addMethod(method);
    }
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:26,代码来源:SelectByExampleWithoutBLOBsMethodGenerator.java

示例12: RootClassInfo

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的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$
    }
}
 
开发者ID:nextyu,项目名称:summer-mybatis-generator,代码行数:25,代码来源:RootClassInfo.java

示例13: generateToString

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的package包/类
private void generateToString(IntrospectedTable introspectedTable, TopLevelClass topLevelClass) {
        Method method = new Method();
        method.setVisibility(JavaVisibility.PUBLIC);
        method.setReturnType(FullyQualifiedJavaType.getStringInstance());
        method.setName("toString");
        if(introspectedTable.isJava5Targeted()) {
            method.addAnnotation("@Override");
        }

        this.context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable);
        method.addBodyLine("StringBuilder sb = new StringBuilder();");
        method.addBodyLine("sb.append(getClass().getSimpleName());");
        method.addBodyLine("sb.append(\" [\");");
//        method.addBodyLine("sb.append(\"Hash = \").append(hashCode());");
        StringBuilder sb = new StringBuilder();
        Iterator var5 = topLevelClass.getFields().iterator();

        while(var5.hasNext()) {
            Field field = (Field)var5.next();
            String property = field.getName();
            sb.setLength(0);
            sb.append("sb.append(\"").append(", ").append(property).append("=\")").append(".append(").append(property).append(");");
            method.addBodyLine(sb.toString());
        }

        method.addBodyLine("sb.append(\"]\");");
//        if(this.useToStringFromRoot && topLevelClass.getSuperClass() != null) {
//            method.addBodyLine("sb.append(\", from super class \");");
//            method.addBodyLine("sb.append(super.toString());");
//        }

        method.addBodyLine("return sb.toString();");
        topLevelClass.addMethod(method);
    }
 
开发者ID:ychaoyang,项目名称:autotest,代码行数:35,代码来源:ToStringPlugin.java

示例14: addInterfaceElements

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

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

示例15: addMapperAnnotations

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; //导入依赖的package包/类
@Override
public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.UpdateProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@UpdateProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getUpdateByPrimaryKeySelectiveStatementId());
    sb.append("\")"); //$NON-NLS-1$
    
    method.addAnnotation(sb.toString());
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:14,代码来源:AnnotatedUpdateByPrimaryKeySelectiveMethodGenerator.java


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