All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.jrouter.paging.ibatis.delegate.BoundSqlDelegate Maven / Gradle / Ivy

package net.jrouter.paging.ibatis.delegate;

import java.util.Collections;
import java.util.List;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.session.Configuration;

/**
 * BoundSql delegate.
 *
 * @see SqlSourceDelegate
 */
class BoundSqlDelegate extends BoundSql {

    /**
     * BoundSql delegate.
     */
    private final BoundSql delegate;

    /**
     * @see BoundSql#getSql()
     */
    private final String sql;

    public BoundSqlDelegate(String sql, BoundSql delegate, Configuration c) {
        super(c, sql, Collections.emptyList(), Collections.EMPTY_MAP);
        this.delegate = delegate;
        this.sql = sql;
    }

    /**
     * 直接返回由构造器传递的已转换sql。
     */
    @Override
    public String getSql() {
        return sql;
    }

    @Override
    public List getParameterMappings() {
        return delegate.getParameterMappings();
    }

    @Override
    public Object getParameterObject() {
        return delegate.getParameterObject();
    }

    @Override
    public boolean hasAdditionalParameter(String name) {
        return delegate.hasAdditionalParameter(name);
    }

    @Override
    public void setAdditionalParameter(String name, Object value) {
        delegate.setAdditionalParameter(name, value);
    }

    @Override
    public Object getAdditionalParameter(String name) {
        return delegate.getAdditionalParameter(name);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy