Java Code Examples for org.apache.ibatis.builder.annotation.ProviderSqlSource

The following examples show how to use org.apache.ibatis.builder.annotation.ProviderSqlSource. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tk-mybatis   Source File: MapperHelper.java    License: MIT License 6 votes vote down vote up
/**
 * 配置指定的接口
 *
 * @param configuration
 * @param mapperInterface
 */
public void processConfiguration(Configuration configuration, Class<?> mapperInterface) {
    String prefix;
    if (mapperInterface != null) {
        prefix = mapperInterface.getCanonicalName();
    } else {
        prefix = "";
    }
    for (Object object : new ArrayList<Object>(configuration.getMappedStatements())) {
        if (object instanceof MappedStatement) {
            MappedStatement ms = (MappedStatement) object;
            if (ms.getId().startsWith(prefix) && isMapperMethod(ms.getId())) {
                if (ms.getSqlSource() instanceof ProviderSqlSource) {
                    setSqlSource(ms);
                }
            }
        }
    }
}
 
Example 2
Source Project: Mapper   Source File: MapperHelper.java    License: MIT License 5 votes vote down vote up
/**
 * 处理 MappedStatement
 *
 * @param ms
 */
public void processMappedStatement(MappedStatement ms){
    MapperTemplate mapperTemplate = isMapperMethod(ms.getId());
    if(mapperTemplate != null && ms.getSqlSource() instanceof ProviderSqlSource) {
        setSqlSource(ms, mapperTemplate);
    }
}
 
Example 3
Source Project: genericdao   Source File: SqlUtil.java    License: Artistic License 2.0 4 votes vote down vote up
private MyProviderSqlSource(Configuration configuration, ProviderSqlSource providerSqlSource, Boolean count) {
    this.configuration = configuration;
    this.providerSqlSource = providerSqlSource;
    this.count = count;
}