本文整理汇总了Java中com.baomidou.mybatisplus.mapper.BaseMapper类的典型用法代码示例。如果您正苦于以下问题:Java BaseMapper类的具体用法?Java BaseMapper怎么用?Java BaseMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseMapper类属于com.baomidou.mybatisplus.mapper包,在下文中一共展示了BaseMapper类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindMapperForNamespace
import com.baomidou.mybatisplus.mapper.BaseMapper; //导入依赖的package包/类
private void bindMapperForNamespace() {
String namespace = builderAssistant.getCurrentNamespace();
if (namespace != null) {
Class<?> boundType = null;
try {
boundType = Resources.classForName(namespace);
} catch (ClassNotFoundException e) {
// ignore, bound type is not required
}
if (boundType != null) {
if (!configuration.hasMapper(boundType)) {
// Spring may not know the real resource name so we set a
// flag
// to prevent loading again this resource from the mapper
// interface
// look at MapperAnnotationBuilder#loadXmlResource
configuration.addLoadedResource("namespace:" + namespace);
configuration.addMapper(boundType);
}
//TODO 注入 CURD 动态 SQL
if (BaseMapper.class.isAssignableFrom(boundType)) {
GlobalConfigUtils.getSqlInjector(configuration).inspectInject(builderAssistant, boundType);
}
}
}
}
示例2: parse
import com.baomidou.mybatisplus.mapper.BaseMapper; //导入依赖的package包/类
@Override
public void parse() {
String resource = type.toString();
if (!configuration.isResourceLoaded(resource)) {
loadXmlResource();
configuration.addLoadedResource(resource);
assistant.setCurrentNamespace(type.getName());
parseCache();
parseCacheRef();
Method[] methods = type.getMethods();
// TODO 注入 CURD 动态 SQL (应该在注解之前注入)
if (BaseMapper.class.isAssignableFrom(type)) {
GlobalConfigUtils.getSqlInjector(configuration).inspectInject(assistant, type);
}
for (Method method : methods) {
try {
// issue #237
if (!method.isBridge()) {
parseStatement(method);
}
} catch (IncompleteElementException e) {
configuration.addIncompleteMethod(new MethodResolver(this, method));
}
}
}
parsePendingMethods();
}
示例3: inspectInject
import com.baomidou.mybatisplus.mapper.BaseMapper; //导入依赖的package包/类
private void inspectInject(boolean flag) {
if (!flag && BaseMapper.class.isAssignableFrom(type)) {
GlobalConfigUtils.getSqlInjector(configuration).inspectInject(assistant, type);
}
}