Example usage for org.apache.ibatis.binding BindingException BindingException

List of usage examples for org.apache.ibatis.binding BindingException BindingException

Introduction

In this page you can find the example usage for org.apache.ibatis.binding BindingException BindingException.

Prototype

public BindingException(String message, Throwable cause) 

Source Link

Usage

From source file:com.yimidida.shards.cfg.MyBatisConfigurationsWrapper.java

License:Open Source License

@Override
public MappedStatement getMappedStatement(String id) {
    Exception exception = null;/*from  www.  j  a va2 s  .c  o m*/
    MappedStatement mappedStatement = null;
    for (SqlSessionFactory sqlSessionFactory : getSqlSessionFactories()) {
        try {
            mappedStatement = sqlSessionFactory.getConfiguration().getMappedStatement(id);
        } catch (Exception e) {
            // ignore exception
            exception = e;
        }

        if (mappedStatement != null) {
            return mappedStatement;
        }
    }

    throw new BindingException("Invalid bound statement (not found): " + id, exception);
}