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

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


    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

      sb.setLength(0);
      sb.append(Ibatis2FormattingUtilities.getEscapedColumnName(introspectedColumn));
      sb.append(" = "); //$NON-NLS-1$
      sb.append(Ibatis2FormattingUtilities.getParameterClause(introspectedColumn, "condition."));
      isNotNullElement.addElement(new TextElement(sb.toString()));
    }

    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

    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

    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[ ) row_ where rownum <= (#limit# + #start#) ) where rownum_ > #start# ]]>"));
    outerisNotEmptyElement.addElement(innerisNotEmptyElement);
    dynamicElement.addElement(outerisNotEmptyElement);
    answer.addElement(dynamicElement);
    return answer;
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[ limit #start# , #limit# ]]>"));
    outerisNotEmptyElement.addElement(innerisNotEmptyElement);
    dynamicElement.addElement(outerisNotEmptyElement);
    answer.addElement(dynamicElement);
    return answer;
  }
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.