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

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


  {
    XmlElement parentElement = document.getRootElement();

    // 生成selectByMap的sql映射
    XmlElement answer = new XmlElement("select"); //$NON-NLS-1$
    answer.addAttribute(new Attribute("id", "selectByMap")); //$NON-NLS-1$
    answer.addAttribute(new Attribute(
        "resultMap", introspectedTable.getBaseResultMapId())); //$NON-NLS-1$
    answer.addAttribute(new Attribute("parameterType", "Map")); //$NON-NLS-1$

    context.getCommentGenerator().addComment(answer);
View Full Code Here


    XmlElement parentElement = document.getRootElement();

    // 生成selectByMap的sql映射
    XmlElement answer = new XmlElement("select"); //$NON-NLS-1$
    answer.addAttribute(new Attribute("id", "selectByMap")); //$NON-NLS-1$
    answer.addAttribute(new Attribute(
        "resultMap", introspectedTable.getBaseResultMapId())); //$NON-NLS-1$
    answer.addAttribute(new Attribute("parameterType", "Map")); //$NON-NLS-1$

    context.getCommentGenerator().addComment(answer);
View Full Code Here

    // 生成selectByMap的sql映射
    XmlElement answer = new XmlElement("select"); //$NON-NLS-1$
    answer.addAttribute(new Attribute("id", "selectByMap")); //$NON-NLS-1$
    answer.addAttribute(new Attribute(
        "resultMap", introspectedTable.getBaseResultMapId())); //$NON-NLS-1$
    answer.addAttribute(new Attribute("parameterType", "Map")); //$NON-NLS-1$

    context.getCommentGenerator().addComment(answer);

    StringBuilder sb = new StringBuilder();
    sb.append("select * from "); //$NON-NLS-1$
View Full Code Here

    {
      XmlElement isNotNullElement = new XmlElement("if"); //$NON-NLS-1$
      sb.setLength(0);
      sb.append(introspectedColumn.getJavaProperty()); //$NON-NLS-1$
      sb.append(" != null"); //$NON-NLS-1$
      isNotNullElement.addAttribute(new Attribute("test", sb.toString())); //$NON-NLS-1$

      sb.setLength(0);
      sb.append("and ");
      sb.append(MyBatis3FormattingUtilities
          .getAliasedEscapedColumnName(introspectedColumn));
View Full Code Here

 
  protected XmlElement getExampleIncludeElement(
      IntrospectedTable introspectedTable)
  {
    XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
    ifElement.addAttribute(new Attribute("test", "_parameter != null")); //$NON-NLS-1$ //$NON-NLS-2$

    XmlElement includeElement = new XmlElement("include"); //$NON-NLS-1$
    includeElement.addAttribute(new Attribute("refid", //$NON-NLS-1$
        introspectedTable.getExampleWhereClauseId()));
    ifElement.addElement(includeElement);
View Full Code Here

  {
    XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
    ifElement.addAttribute(new Attribute("test", "_parameter != null")); //$NON-NLS-1$ //$NON-NLS-2$

    XmlElement includeElement = new XmlElement("include"); //$NON-NLS-1$
    includeElement.addAttribute(new Attribute("refid", //$NON-NLS-1$
        introspectedTable.getExampleWhereClauseId()));
    ifElement.addElement(includeElement);

    return ifElement;
  }
View Full Code Here

  protected XmlElement getBaseColumnListElement(
      IntrospectedTable introspectedTable)
  {
    XmlElement answer = new XmlElement("include");
    answer.addAttribute(new Attribute("refid",
        introspectedTable.getBaseColumnListId()));
    return answer;
  }

  protected XmlElement getBlobColumnListElement(
View Full Code Here

  protected XmlElement getBlobColumnListElement(
      IntrospectedTable introspectedTable)
  {
    XmlElement answer = new XmlElement("include");
    answer.addAttribute(new Attribute("refid",
        introspectedTable.getBlobColumnListId()));
    return answer;
  }

  /**
 
View Full Code Here

  @Override
  public boolean sqlMapSelectByExampleWithBLOBsElementGenerated(
      XmlElement element, IntrospectedTable introspectedTable)
  {
    XmlElement ifElement = new XmlElement("if");
    ifElement.addAttribute(new Attribute("test", "pageSize > 0"));
    ifElement.addElement(new TextElement("limit ${startIndex},${pageSize}"));
    element.addElement(ifElement);
    return true;
  }
View Full Code Here

  @Override
  public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(
      XmlElement element, IntrospectedTable introspectedTable)
  {
    XmlElement ifElement = new XmlElement("if");
    ifElement.addAttribute(new Attribute("test", "pageSize > 0"));
    ifElement.addElement(new TextElement("limit ${startIndex},${pageSize}"));
    element.addElement(ifElement);
    return true;
  }
}
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.