Package org.mybatis.generator.api.dom.java

Examples of org.mybatis.generator.api.dom.java.InnerClass.addMethod()


    method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
    method.addBodyLine("if (condition == null) {"); //$NON-NLS-1$
    method.addBodyLine("throw new RuntimeException(\"Value for condition cannot be null\");"); //$NON-NLS-1$
    method.addBodyLine("}"); //$NON-NLS-1$
    method.addBodyLine("criteriaWithoutValue.add(condition);"); //$NON-NLS-1$
    answer.addMethod(method);

    method = new Method();
    method.setVisibility(JavaVisibility.PROTECTED);
    method.setName("addCriterion"); //$NON-NLS-1$
    method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
View Full Code Here


    }

    method.addBodyLine("map.put(\"condition\", condition);"); //$NON-NLS-1$
    method.addBodyLine("map.put(\"value\", value);"); //$NON-NLS-1$
    method.addBodyLine("criteriaWithSingleValue.add(map);"); //$NON-NLS-1$
    answer.addMethod(method);

    FullyQualifiedJavaType listOfObjects;
    if (generateForJava5) {
      listOfObjects = new FullyQualifiedJavaType("java.util.List<? extends java.lang.Object>"); //$NON-NLS-1$
    } else {
View Full Code Here

    }

    method.addBodyLine("map.put(\"condition\", condition);"); //$NON-NLS-1$
    method.addBodyLine("map.put(\"values\", values);"); //$NON-NLS-1$
    method.addBodyLine("criteriaWithListValue.add(map);"); //$NON-NLS-1$
    answer.addMethod(method);

    method = new Method();
    method.setVisibility(JavaVisibility.PROTECTED);
    method.setName("addCriterion"); //$NON-NLS-1$
    method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
View Full Code Here

      method.addBodyLine("Map map = new HashMap();"); //$NON-NLS-1$
    }
    method.addBodyLine("map.put(\"condition\", condition);"); //$NON-NLS-1$
    method.addBodyLine("map.put(\"values\", list);"); //$NON-NLS-1$
    method.addBodyLine("criteriaWithBetweenValue.add(map);"); //$NON-NLS-1$
    answer.addMethod(method);

    FullyQualifiedJavaType listOfDates;
    if (generateForJava5) {
      listOfDates = new FullyQualifiedJavaType("java.util.List<java.util.Date>"); //$NON-NLS-1$
    } else {
View Full Code Here

      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "property")); //$NON-NLS-1$
      method.addBodyLine("if (value == null) {"); //$NON-NLS-1$
      method.addBodyLine("throw new RuntimeException(\"Value for \" + property + \" cannot be null\");"); //$NON-NLS-1$
      method.addBodyLine("}"); //$NON-NLS-1$
      method.addBodyLine("addCriterion(condition, new java.sql.Date(value.getTime()), property);"); //$NON-NLS-1$
      answer.addMethod(method);

      method = new Method();
      method.setVisibility(JavaVisibility.PROTECTED);
      method.setName("addCriterionForJDBCDate"); //$NON-NLS-1$
      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
View Full Code Here

        method.addBodyLine("while (iter.hasNext()) {"); //$NON-NLS-1$
        method.addBodyLine("dateList.add(new java.sql.Date(((Date)iter.next()).getTime()));"); //$NON-NLS-1$
        method.addBodyLine("}"); //$NON-NLS-1$
      }
      method.addBodyLine("addCriterion(condition, dateList, property);"); //$NON-NLS-1$
      answer.addMethod(method);

      method = new Method();
      method.setVisibility(JavaVisibility.PROTECTED);
      method.setName("addCriterionForJDBCDate"); //$NON-NLS-1$
      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
View Full Code Here

      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "property")); //$NON-NLS-1$
      method.addBodyLine("if (value1 == null || value2 == null) {"); //$NON-NLS-1$
      method.addBodyLine("throw new RuntimeException(\"Between values for \" + property + \" cannot be null\");"); //$NON-NLS-1$
      method.addBodyLine("}"); //$NON-NLS-1$
      method.addBodyLine("addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);"); //$NON-NLS-1$
      answer.addMethod(method);
    }

    if (introspectedTable.hasJDBCTimeColumns()) {
      topLevelClass.addImportedType(FullyQualifiedJavaType.getDateInstance());
      topLevelClass.addImportedType(FullyQualifiedJavaType.getNewIteratorInstance());
View Full Code Here

      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "property")); //$NON-NLS-1$
      method.addBodyLine("if (value == null) {"); //$NON-NLS-1$
      method.addBodyLine("throw new RuntimeException(\"Value for \" + property + \" cannot be null\");"); //$NON-NLS-1$
      method.addBodyLine("}"); //$NON-NLS-1$
      method.addBodyLine("addCriterion(condition, new java.sql.Time(value.getTime()), property);"); //$NON-NLS-1$
      answer.addMethod(method);

      method = new Method();
      method.setVisibility(JavaVisibility.PROTECTED);
      method.setName("addCriterionForJDBCTime"); //$NON-NLS-1$
      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
View Full Code Here

        method.addBodyLine("while (iter.hasNext()) {"); //$NON-NLS-1$
        method.addBodyLine("timeList.add(new java.sql.Time(((Date)iter.next()).getTime()));"); //$NON-NLS-1$
        method.addBodyLine("}"); //$NON-NLS-1$
      }
      method.addBodyLine("addCriterion(condition, timeList, property);"); //$NON-NLS-1$
      answer.addMethod(method);

      method = new Method();
      method.setVisibility(JavaVisibility.PROTECTED);
      method.setName("addCriterionForJDBCTime"); //$NON-NLS-1$
      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
View Full Code Here

      method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "property")); //$NON-NLS-1$
      method.addBodyLine("if (value1 == null || value2 == null) {"); //$NON-NLS-1$
      method.addBodyLine("throw new RuntimeException(\"Between values for \" + property + \" cannot be null\");"); //$NON-NLS-1$
      method.addBodyLine("}"); //$NON-NLS-1$
      method.addBodyLine("addCriterion(condition, new java.sql.Time(value1.getTime()), new java.sql.Time(value2.getTime()), property);"); //$NON-NLS-1$
      answer.addMethod(method);
    }

    for (IntrospectedColumn introspectedColumn : introspectedTable.getNonBLOBColumns()) {
      topLevelClass.addImportedType(introspectedColumn.getFullyQualifiedJavaType());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.