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

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


    elementGenerator.addElements(parentElement);
  }

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

    if (!context.getPlugins().sqlMapDocumentGenerated(document, introspectedTable)) {
      document = null;
    }
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(),
                true, context.getXmlFormatter());
        if (context.getPlugins().sqlMapGenerated(gxf, this)) {
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(),
                true, context.getXmlFormatter());
            if (context.getPlugins().sqlMapGenerated(gxf, this)) {
View Full Code Here

        elementGenerator.addElements(parentElement);
    }

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

        if (!context.getPlugins().sqlMapDocumentGenerated(document,
                introspectedTable)) {
            document = null;
        }
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

     * We will initialize file contents with a sample text.
     */

    private InputStream openContentStream() {

        Document document = new Document(XmlConstants.MYBATIS_GENERATOR_CONFIG_PUBLIC_ID,
                XmlConstants.MYBATIS_GENERATOR_CONFIG_SYSTEM_ID);

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

        XmlElement context = new XmlElement("context"); //$NON-NLS-1$
        context.addAttribute(new Attribute("id", "context1")); //$NON-NLS-1$ //$NON-NLS-2$
        generatorConfiguration.addElement(context);

        XmlElement jdbcConnection = new XmlElement("jdbcConnection"); //$NON-NLS-1$
        jdbcConnection.addAttribute(new Attribute("driverClass", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        jdbcConnection.addAttribute(new Attribute("connectionURL", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        jdbcConnection.addAttribute(new Attribute("userId", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        jdbcConnection.addAttribute(new Attribute("password", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        context.addElement(jdbcConnection);

        XmlElement javaModelGenerator = new XmlElement("javaModelGenerator"); //$NON-NLS-1$
        javaModelGenerator.addAttribute(new Attribute("targetPackage", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        javaModelGenerator.addAttribute(new Attribute("targetProject", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        context.addElement(javaModelGenerator);

        XmlElement sqlMapGenerator = new XmlElement("sqlMapGenerator"); //$NON-NLS-1$
        sqlMapGenerator.addAttribute(new Attribute("targetPackage", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        sqlMapGenerator.addAttribute(new Attribute("targetProject", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        context.addElement(sqlMapGenerator);

        XmlElement javaClientGenerator = new XmlElement("javaClientGenerator"); //$NON-NLS-1$
        javaClientGenerator.addAttribute(new Attribute("targetPackage", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        javaClientGenerator.addAttribute(new Attribute("targetProject", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        javaClientGenerator.addAttribute(new Attribute("type", "XMLMAPPER")); //$NON-NLS-1$ //$NON-NLS-2$
        context.addElement(javaClientGenerator);

        XmlElement table = new XmlElement("table"); //$NON-NLS-1$
        table.addAttribute(new Attribute("schema", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        table.addAttribute(new Attribute("tableName", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        XmlElement columnOverride = new XmlElement("columnOverride"); //$NON-NLS-1$
        columnOverride.addAttribute(new Attribute("column", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        columnOverride.addAttribute(new Attribute("property", "???")); //$NON-NLS-1$ //$NON-NLS-2$
        table.addElement(columnOverride);
        context.addElement(table);

        return new ByteArrayInputStream(document.getFormattedContent()
                .getBytes());
    }
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

        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

    @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(),
                true);
        if (context.getPlugins().sqlMapGenerated(gxf, this)) {
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
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.