当前位置: 首页>>代码示例>>Java>>正文


Java BaseMapper类代码示例

本文整理汇总了Java中org.beetl.sql.core.mapper.BaseMapper的典型用法代码示例。如果您正苦于以下问题:Java BaseMapper类的具体用法?Java BaseMapper怎么用?Java BaseMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BaseMapper类属于org.beetl.sql.core.mapper包,在下文中一共展示了BaseMapper类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: foundMapper

import org.beetl.sql.core.mapper.BaseMapper; //导入依赖的package包/类
@SubClassFinder(noAbstract = false, callOn = AppEventId.PRE_START)
public void foundMapper(Class<? extends BaseMapper> mapperClass) {
    DbServiceManager dbServiceManager = app.dbServiceManager();
    try {
        Class<?> modelClass = modelClass(mapperClass);
        DbService dbService = dbServiceManager.dbService(dbId(modelClass));
        if (dbService instanceof BeetlSqlService) {
            ((BeetlSqlService) dbService).prepareMapperClass(mapperClass, modelClass);
        } else {
            throw new UnexpectedException("mapper class cannot be landed to a BeetlSqlService");
        }
    } catch (RuntimeException e) {
        LOGGER.warn(e, "Error registering mapping class: %s", mapperClass);
    }
}
 
开发者ID:actframework,项目名称:act-beetlsql,代码行数:16,代码来源:BeetlClassFinder.java

示例2: modelClass

import org.beetl.sql.core.mapper.BaseMapper; //导入依赖的package包/类
static Class<?> modelClass(Class<? extends BaseMapper> mapperClass) {
    List<Type> paramTypes = Generics.typeParamImplementations(mapperClass, BaseMapper.class);
    if (paramTypes.size() != 1) {
        throw new UnexpectedException("Cannot determine parameter type of %s", mapperClass);
    }
    Type type = paramTypes.get(0);
    if (!(type instanceof Class)) {
        throw new UnexpectedException("Cannot determine parameter type of %s", mapperClass);
    }
    return $.cast(type);
}
 
开发者ID:actframework,项目名称:act-beetlsql,代码行数:12,代码来源:BeetlClassFinder.java

示例3: load

import org.beetl.sql.core.mapper.BaseMapper; //导入依赖的package包/类
@Override
public BaseMapper load(BeanSpec beanSpec) {
    List<Type> typeList = beanSpec.typeParams();
    int sz = typeList.size();
    if (sz > 0) {
        Class<?> modelType = BeanSpec.rawTypeOf(typeList.get(0));
        String dbId = DbServiceManager.dbId(modelType);
        DbService service = Act.app().dbServiceManager().dbService(dbId);
        if (service instanceof BeetlSqlService) {
            BeetlSqlService beetl = $.cast(service);
            return beetl.mapper(modelType);
        }
    }
    return null;
}
 
开发者ID:actframework,项目名称:act-beetlsql,代码行数:16,代码来源:MapperLoader.java

示例4: prepareMapperClass

import org.beetl.sql.core.mapper.BaseMapper; //导入依赖的package包/类
public void prepareMapperClass(Class<? extends BaseMapper> mapperClass, Class<?> modelClass) {
    Object o = Proxy.newProxyInstance(mapperClass.getClassLoader(),
            new Class<?>[]{mapperClass},
            new MapperJavaProxy(new DefaultMapperBuilder(beetlSql), beetlSql, mapperClass));
    final BaseMapper mapper = $.cast(o);
    mapperMap.put(mapperClass, mapper);
    mapperMap.put(modelClass, mapper);
    Genie genie = Act.getInstance(Genie.class);
    genie.registerProvider(mapperClass, new Provider() {
        @Override
        public Object get() {
            return mapper;
        }
    });
}
 
开发者ID:actframework,项目名称:act-beetlsql,代码行数:16,代码来源:BeetlSqlService.java

示例5: configure

import org.beetl.sql.core.mapper.BaseMapper; //导入依赖的package包/类
@Override
protected void configure() {
    registerGenericTypedBeanLoader(BaseMapper.class, new MapperLoader());
}
 
开发者ID:actframework,项目名称:act-beetlsql,代码行数:5,代码来源:BeeltSqlModule.java

示例6: mapper

import org.beetl.sql.core.mapper.BaseMapper; //导入依赖的package包/类
BaseMapper mapper(Class modelClass) {
    return mapperMap.get(modelClass);
}
 
开发者ID:actframework,项目名称:act-beetlsql,代码行数:4,代码来源:BeetlSqlService.java


注:本文中的org.beetl.sql.core.mapper.BaseMapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。