package me.chyxion.tigon.mybatis;

import org.w3c.dom.Element;
import org.w3c.dom.Document;

/**
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * 14/10/2017 10:43 PM
 */
public class ExistsXmlProcessor extends AbstractOnMissingCreateProcessor {

    /**
     * {@inheritDoc}
     */
    @Override
    protected String missingXPathExpression() {
        return "/mapper/select[@id='exists']";
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected Element elementToAppend(Class<BaseMapper<?, ?>> mapperClass, Document doc) {
        return appendIncludeEl(doc,
            createSelectEl(doc, "exists", "boolean"), "Tigon.exists");
    }
}
