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

The following examples show how to use org.apache.ibatis.builder.annotation.ProviderSqlSource. 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 File: MapperHelper.java    From tk-mybatis with 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 File: MapperHelper.java    From Mapper with 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 File: SqlUtil.java    From genericdao with 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;
}