List of usage examples for org.apache.ibatis.binding MapperProxyFactory MapperProxyFactory
public MapperProxyFactory(Class<T> mapperInterface)
From source file:com.baomidou.mybatisplus.MybatisMapperRegistry.java
License:Apache License
@Override public <T> void addMapper(Class<T> type) { if (type.isInterface()) { if (hasMapper(type)) { // TODO ? return; // throw new BindingException("Type " + type + // " is already known to the MybatisPlusMapperRegistry."); }//from ww w. ja va2 s . co m boolean loadCompleted = false; try { knownMappers.put(type, new MapperProxyFactory<>(type)); // It's important that the type is added before the parser is // run // otherwise the binding may automatically be attempted by the // mapper parser. If the type is already known, it won't try. // TODO XML MybatisMapperAnnotationBuilder parser = new MybatisMapperAnnotationBuilder(config, type); parser.parse(); loadCompleted = true; } finally { if (!loadCompleted) { knownMappers.remove(type); } } } }
From source file:com.mybatisX.core.MybatisMapperRegistry.java
License:Apache License
public <T> void addMapper(Class<T> type) { if (type.isInterface()) { if (hasMapper(type)) { //TODO ? return; // throw new BindingException("Type " + type + // " is already known to the MybatisPlusMapperRegistry."); }//from ww w .j a v a 2 s . c om boolean loadCompleted = false; try { knownMappers.put(type, new MapperProxyFactory<T>(type)); // It's important that the type is added before the parser is // run // otherwise the binding may automatically be attempted by the // mapper parser. If the type is already known, it won't try. //TODO XML MybatisMapperAnnotationBuilder parser = new MybatisMapperAnnotationBuilder(config, type); parser.parse(); loadCompleted = true; } finally { if (!loadCompleted) { knownMappers.remove(type); } } } }