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

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


      oracleHeadIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Head"));
      // 在第一个地方增加
      element.addElement(0, oracleHeadIncludeElement);

      XmlElement oracleTailIncludeElement = new XmlElement("include");
      oracleTailIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Tail"));
      // 在最后增加
      element.addElement(element.getElements().size(), oracleTailIncludeElement);
    } else if (databaseType.contains("mysql")) {
      XmlElement mysqlLimitIncludeElement = new XmlElement("include");
      mysqlLimitIncludeElement.addAttribute(new Attribute("refid", "common.Mysql_Pagination_Limit"));
View Full Code Here


      oracleTailIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Tail"));
      // 在最后增加
      element.addElement(element.getElements().size(), oracleTailIncludeElement);
    } else if (databaseType.contains("mysql")) {
      XmlElement mysqlLimitIncludeElement = new XmlElement("include");
      mysqlLimitIncludeElement.addAttribute(new Attribute("refid", "common.Mysql_Pagination_Limit"));
      // 在最后增加
      element.addElement(element.getElements().size(), mysqlLimitIncludeElement);
    }
    return true;
  }
View Full Code Here

  @Override
  public boolean sqlMapSelectByExampleWithBLOBsElementGenerated(XmlElement element,
      IntrospectedTable introspectedTable) {
    if (databaseType.contains("oracle")) {
      XmlElement oracleHeadIncludeElement = new XmlElement("include");
      oracleHeadIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Head"));
      // 在第一个地方增加
      element.addElement(0, oracleHeadIncludeElement);

      XmlElement oracleTailIncludeElement = new XmlElement("include");
      oracleTailIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Tail"));
View Full Code Here

      oracleHeadIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Head"));
      // 在第一个地方增加
      element.addElement(0, oracleHeadIncludeElement);

      XmlElement oracleTailIncludeElement = new XmlElement("include");
      oracleTailIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Tail"));
      // 在最后增加
      element.addElement(element.getElements().size(), oracleTailIncludeElement);
    } else if (databaseType.contains("mysql")) {
      XmlElement mysqlLimitIncludeElement = new XmlElement("include");
      mysqlLimitIncludeElement.addAttribute(new Attribute("refid", "common.Mysql_Pagination_Limit"));
View Full Code Here

      oracleTailIncludeElement.addAttribute(new Attribute("refid", "common.Oracle_Pagination_Tail"));
      // 在最后增加
      element.addElement(element.getElements().size(), oracleTailIncludeElement);
    } else if (databaseType.contains("mysql")) {
      XmlElement mysqlLimitIncludeElement = new XmlElement("include");
      mysqlLimitIncludeElement.addAttribute(new Attribute("refid", "common.Mysql_Pagination_Limit"));
      // 在最后增加
      element.addElement(element.getElements().size(), mysqlLimitIncludeElement);
    }
    return true;
  }
View Full Code Here

  @Override
  public List<GeneratedXmlFile> contextGenerateAdditionalXmlFiles(IntrospectedTable introspectedTable) {
    Document document = new Document(XmlConstants.IBATIS2_SQL_MAP_PUBLIC_ID, XmlConstants.IBATIS2_SQL_MAP_SYSTEM_ID);
    XmlElement answer = new XmlElement("sqlMap"); //$NON-NLS-1$
    document.setRootElement(answer);
    answer.addAttribute(new Attribute("namespace", //$NON-NLS-1$
        "common"));

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

  }

  private XmlElement getOracleHead() {
    XmlElement answer = new XmlElement("sql"); //$NON-NLS-1$

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

    XmlElement dynamicElement = new XmlElement("dynamic");
    XmlElement outerisNotEmptyElement = new XmlElement("isNotNull");
    outerisNotEmptyElement.addAttribute(new Attribute("property", "limit"));
    XmlElement innerisNotEmptyElement = new XmlElement("isNotNull");
View Full Code Here

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

    XmlElement dynamicElement = new XmlElement("dynamic");
    XmlElement outerisNotEmptyElement = new XmlElement("isNotNull");
    outerisNotEmptyElement.addAttribute(new Attribute("property", "limit"));
    XmlElement innerisNotEmptyElement = new XmlElement("isNotNull");
    innerisNotEmptyElement.addAttribute(new Attribute("property", "start"));
    innerisNotEmptyElement.addElement(new TextElement("<![CDATA[ select * from ( select row_.*, rownum rownum_ from ( ]]>"));
    outerisNotEmptyElement.addElement(innerisNotEmptyElement);
    dynamicElement.addElement(outerisNotEmptyElement);
View Full Code Here

    XmlElement dynamicElement = new XmlElement("dynamic");
    XmlElement outerisNotEmptyElement = new XmlElement("isNotNull");
    outerisNotEmptyElement.addAttribute(new Attribute("property", "limit"));
    XmlElement innerisNotEmptyElement = new XmlElement("isNotNull");
    innerisNotEmptyElement.addAttribute(new Attribute("property", "start"));
    innerisNotEmptyElement.addElement(new TextElement("<![CDATA[ select * from ( select row_.*, rownum rownum_ from ( ]]>"));
    outerisNotEmptyElement.addElement(innerisNotEmptyElement);
    dynamicElement.addElement(outerisNotEmptyElement);
    answer.addElement(dynamicElement);
    return answer;
View Full Code Here

  }

  private XmlElement getOracleTail() {
    XmlElement answer = new XmlElement("sql"); //$NON-NLS-1$

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

    XmlElement dynamicElement = new XmlElement("dynamic");
    XmlElement outerisNotEmptyElement = new XmlElement("isNotNull");
    outerisNotEmptyElement.addAttribute(new Attribute("property", "limit"));
    XmlElement innerisNotEmptyElement = new XmlElement("isNotNull");
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.