Package org.mybatis.generator.api.dom.xml

Examples of org.mybatis.generator.api.dom.xml.XmlElement.addElement()


      } else {

        sb.append(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, "condition."));
      }
      isNotNullElement.addElement(new TextElement(sb.toString()));
    }
    if (!isAllInOne) {

      // Example_Where_Clause
      Where_Clause = (XmlElement) document.getRootElement().getElements().get(2);
View Full Code Here


        sb.setLength(0);
        sb.append(" and "); //$NON-NLS-1$
        sb.append(Ibatis2FormattingUtilities.getEscapedColumnName(introspectedColumn));
        sb.append(" = "); //$NON-NLS-1$
        sb.append(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, "example.condition."));
        isNotNullElement.addElement(new TextElement(sb.toString()));
      }
    } else {
      document.getRootElement().getElements().remove(2);
    }
    return true;
View Full Code Here

    document.setRootElement(answer);
    answer.addAttribute(new Attribute("namespace", //$NON-NLS-1$
        "common"));

    if (databaseType.contains("oracle")) {
      answer.addElement(getOracleHead());
      answer.addElement(getOracleTail());
    } else if (databaseType.contains("mysql")) {
      answer.addElement(getMysqlLimit());
    }
View Full Code Here

    answer.addAttribute(new Attribute("namespace", //$NON-NLS-1$
        "common"));

    if (databaseType.contains("oracle")) {
      answer.addElement(getOracleHead());
      answer.addElement(getOracleTail());
    } else if (databaseType.contains("mysql")) {
      answer.addElement(getMysqlLimit());
    }

    GeneratedXmlFile gxf = new GeneratedXmlFile(document, properties.getProperty("fileName", "common_SqlMap.xml"), //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    if (databaseType.contains("oracle")) {
      answer.addElement(getOracleHead());
      answer.addElement(getOracleTail());
    } else if (databaseType.contains("mysql")) {
      answer.addElement(getMysqlLimit());
    }

    GeneratedXmlFile gxf = new GeneratedXmlFile(document, properties.getProperty("fileName", "common_SqlMap.xml"), //$NON-NLS-1$ //$NON-NLS-2$
        context.getSqlMapGeneratorConfiguration().getTargetPackage(), //$NON-NLS-1$
        context.getSqlMapGeneratorConfiguration().getTargetProject(), //$NON-NLS-1$
View Full Code Here

    answer.addAttribute(new Attribute("id", "Oracle_Pagination_Head")); //$NON-NLS-1$

    XmlElement outerisNotEmptyElement = new XmlElement("if");
    outerisNotEmptyElement.addAttribute(new Attribute("test", "limit != null and start != null"));
    outerisNotEmptyElement.addElement(new TextElement("<![CDATA[ select * from ( select row_.*, rownum rownum_ from ( ]]>"));
    answer.addElement(outerisNotEmptyElement);
    return answer;
  }

  private XmlElement getOracleTail() {
View Full Code Here

    answer.addAttribute(new Attribute("id", "Oracle_Pagination_Tail")); //$NON-NLS-1$

    XmlElement outerisNotEmptyElement = new XmlElement("if");
    outerisNotEmptyElement.addAttribute(new Attribute("test", "limit != null and start != null"));
    outerisNotEmptyElement.addElement(new TextElement(
        "<![CDATA[ ) row_ where rownum <= (#{limit} + #{start}) ) where rownum_ > #{start} ]]>"));
    answer.addElement(outerisNotEmptyElement);
    return answer;
  }
View Full Code Here

    answer.addAttribute(new Attribute("id", "Mysql_Pagination_Limit")); //$NON-NLS-1$

    XmlElement outerisNotEmptyElement = new XmlElement("if");
    outerisNotEmptyElement.addAttribute(new Attribute("test", "limit != null and start != null"));
    outerisNotEmptyElement.addElement(new TextElement("<![CDATA[ limit #{start} , #{limit} ]]>"));
    answer.addElement(outerisNotEmptyElement);
    return answer;
  }
}
View Full Code Here

        XmlConstants.MYBATIS3_MAPPER_CONFIG_SYSTEM_ID);

    XmlElement root = new XmlElement("configuration"); //$NON-NLS-1$
    document.setRootElement(root);

    root.addElement(new TextElement("<!--")); //$NON-NLS-1$
    root.addElement(new TextElement("  This file is generated by MyBatis Generator.")); //$NON-NLS-1$
    root.addElement(new TextElement(
        "  This file is the shell of a Mapper Config file - in many cases you will need to add")); //$NON-NLS-1$
    root.addElement(new TextElement("    to this file before it is usable by MyBatis.")); //$NON-NLS-1$
View Full Code Here

    XmlElement root = new XmlElement("configuration"); //$NON-NLS-1$
    document.setRootElement(root);

    root.addElement(new TextElement("<!--")); //$NON-NLS-1$
    root.addElement(new TextElement("  This file is generated by MyBatis Generator.")); //$NON-NLS-1$
    root.addElement(new TextElement(
        "  This file is the shell of a Mapper Config file - in many cases you will need to add")); //$NON-NLS-1$
    root.addElement(new TextElement("    to this file before it is usable by MyBatis.")); //$NON-NLS-1$

    StringBuilder sb = new StringBuilder();
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.