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

Examples of org.mybatis.generator.api.dom.xml.Document


  public List<GeneratedXmlFile> contextGenerateAdditionalXmlFiles(
      IntrospectedTable introspectedTable)
  {
    XmlElement parent = new XmlElement("struts"); //$NON-NLS-1$
    addPackageElement(parent, introspectedTable, parentModulName);
    Document document = new Document(STRUTS_PUBLIC_ID, STRUTS_SYSTEM_ID);
    document.setRootElement(parent);
    GeneratedXmlFile gxf = new GeneratedXmlFile(document, strutsXmlFileName
        + ".xml", strutsXmlFilePath, targetProject, isMergeable);
    List<GeneratedXmlFile> gxfs = new ArrayList<GeneratedXmlFile>();
    gxfs.add(gxf);
    return gxfs;
View Full Code Here


    return true;
  }

  @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());
View Full Code Here

    return true;
  }

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

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

    return valid;
  }

  @Override
  public List<GeneratedXmlFile> contextGenerateAdditionalXmlFiles() {
    Document document = new Document(XmlConstants.MYBATIS3_MAPPER_CONFIG_PUBLIC_ID,
        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$
View Full Code Here

    return valid;
  }

  @Override
  public List<GeneratedXmlFile> contextGenerateAdditionalXmlFiles() {
    Document document = new Document(XmlConstants.IBATIS2_SQL_MAP_CONFIG_PUBLIC_ID,
        XmlConstants.IBATIS2_SQL_MAP_CONFIG_SYSTEM_ID);

    XmlElement root = new XmlElement("sqlMapConfig"); //$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 an SqlMapConfig file - in many cases you will need to add")); //$NON-NLS-1$
View Full Code Here

  @Override
  public List<GeneratedXmlFile> getGeneratedXmlFiles() {
    List<GeneratedXmlFile> answer = new ArrayList<GeneratedXmlFile>();

    Document document = sqlMapGenerator.getDocument();
    GeneratedXmlFile gxf = new GeneratedXmlFile(document, getIbatis2SqlMapFileName(), getIbatis2SqlMapPackage(),
        context.getSqlMapGeneratorConfiguration().getTargetProject(), false);
    if (context.getPlugins().sqlMapGenerated(gxf, this)) {
      answer.add(gxf);
    }
View Full Code Here

  @Override
  public List<GeneratedXmlFile> getGeneratedXmlFiles() {
    List<GeneratedXmlFile> answer = new ArrayList<GeneratedXmlFile>();

    if (xmlMapperGenerator != null) {
      Document document = xmlMapperGenerator.getDocument();
      GeneratedXmlFile gxf = new GeneratedXmlFile(document, getMyBatis3XmlMapperFileName(),
          getMyBatis3XmlMapperPackage(), context.getSqlMapGeneratorConfiguration().getTargetProject(), false);
      if (context.getPlugins().sqlMapGenerated(gxf, this)) {
        answer.add(gxf);
      }
View Full Code Here

    elementGenerator.addElements(parentElement);
  }

  @Override
  public Document getDocument() {
    Document document = new Document(XmlConstants.MYBATIS3_MAPPER_PUBLIC_ID, XmlConstants.MYBATIS3_MAPPER_SYSTEM_ID);
    document.setRootElement(getSqlMapElement());

    if (!context.getPlugins().sqlMapDocumentGenerated(document, introspectedTable)) {
      document = null;
    }
View Full Code Here

    return true;
  }

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

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

   */
  public Document toDocument() {
    // note that this method will not reconstruct a properties
    // element - that element is only used in XML parsing

    Document document = new Document(XmlConstants.MYBATIS_GENERATOR_CONFIG_PUBLIC_ID,
        XmlConstants.MYBATIS_GENERATOR_CONFIG_SYSTEM_ID);
    XmlElement rootElement = new XmlElement("generatorConfiguration"); //$NON-NLS-1$
    document.setRootElement(rootElement);

    for (String classPathEntry : classPathEntries) {
      XmlElement cpeElement = new XmlElement("classPathEntry"); //$NON-NLS-1$
      cpeElement.addAttribute(new Attribute("location", classPathEntry)); //$NON-NLS-1$
      rootElement.addElement(cpeElement);
View Full Code Here

TOP

Related Classes of org.mybatis.generator.api.dom.xml.Document

Copyright © 2018 www.massapicom. 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.