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


Java SelectQuery类代码示例

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


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

示例1: handle

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
public Supplier<RESULT> handle(ResultSet resultSet, SelectQuery query,
        ResultSetRowIndexConsumer consumer) throws SQLException {
    ObjectProvider<TARGET> provider = createObjectProvider(query);
    Iterator<TARGET> iterator = new ResultSetIterator<>(resultSet, query,
            consumer, provider);
    try {
        if (query.getFetchType() == FetchType.EAGER) {
            // consume ResultSet
            Iterator<TARGET> it = IteratorUtil.copy(iterator);
            return () -> iterate(it);
        } else {
            RESULT result = iterate(iterator);
            return () -> result;
        }
    } catch (SQLRuntimeException e) {
        throw e.getCause();
    }
}
 
开发者ID:domaframework,项目名称:doma,代码行数:20,代码来源:AbstractIterationHandler.java

示例2: SelectCommand

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
public SelectCommand(SelectQuery query,
        ResultSetHandler<RESULT> resultSetHandler) {
    assertNotNull(query, resultSetHandler);
    this.query = query;
    this.sql = query.getSql();
    this.resultSetHandler = resultSetHandler;
}
 
开发者ID:domaframework,项目名称:doma,代码行数:8,代码来源:SelectCommand.java

示例3: ResultSetIterator

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
public ResultSetIterator(ResultSet resultSet, SelectQuery query,
        ResultSetRowIndexConsumer consumer, ObjectProvider<TARGET> provider)
        throws SQLException {
    assertNotNull(resultSet, query, consumer, provider);
    this.resultSet = resultSet;
    this.query = query;
    this.consumer = consumer;
    this.provider = provider;
    this.next = resultSet.next();
    consumer.accept(index, next);
    index++;
}
 
开发者ID:domaframework,项目名称:doma,代码行数:13,代码来源:ResultSetIterator.java

示例4: handle

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
public Supplier<RESULT> handle(ResultSet resultSet, SelectQuery query,
        ResultSetRowIndexConsumer consumer) throws SQLException {
    Supplier<RESULT> result = handler.handle(resultSet, query,
            (index, next) -> {
                consumer.accept(index, next);
                if (index == 0 && next) {
                    Sql<?> sql = query.getSql();
                    throw new NonUniqueResultException(query.getConfig()
                            .getExceptionSqlLogType(), sql);
                }
            });
    return result;
}
 
开发者ID:domaframework,项目名称:doma,代码行数:15,代码来源:AbstractSingleResultHandler.java

示例5: handle

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
Supplier<RESULT> handle(ResultSet resultSet, SelectQuery query,
ResultSetRowIndexConsumer consumer) throws SQLException;
 
开发者ID:domaframework,项目名称:doma,代码行数:3,代码来源:ResultSetHandler.java

示例6: handle

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
public Supplier<RESULT> handle(ResultSet resultSet, SelectQuery query,
        ResultSetRowIndexConsumer consumer) throws SQLException {
    return handler.handle(resultSet, query, consumer);
}
 
开发者ID:domaframework,项目名称:doma,代码行数:6,代码来源:AbstractCollectorHandler.java

示例7: handle

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
public Supplier<List<ELEMENT>> handle(ResultSet resultSet,
        SelectQuery query, ResultSetRowIndexConsumer consumer)
        throws SQLException {
    return handler.handle(resultSet, query, consumer);
}
 
开发者ID:domaframework,项目名称:doma,代码行数:7,代码来源:AbstractResultListHandler.java

示例8: createObjectProvider

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
protected abstract ObjectProvider<TARGET> createObjectProvider(
SelectQuery query);
 
开发者ID:domaframework,项目名称:doma,代码行数:3,代码来源:AbstractStreamHandler.java

示例9: createObjectProvider

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
protected ScalarProvider<BASIC, CONTAINER> createObjectProvider(
        SelectQuery query) {
    return new ScalarProvider<>(supplier, query);
}
 
开发者ID:domaframework,项目名称:doma,代码行数:6,代码来源:ScalarStreamHandler.java

示例10: createObjectProvider

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
protected ObjectProvider<ENTITY> createObjectProvider(SelectQuery query) {
    return new EntityProvider<>(entityType, query,
            query.isResultMappingEnsured());
}
 
开发者ID:domaframework,项目名称:doma,代码行数:6,代码来源:EntityStreamHandler.java

示例11: createObjectProvider

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
protected MapProvider createObjectProvider(SelectQuery query) {
    return new MapProvider(query, mapKeyNamingType);
}
 
开发者ID:domaframework,项目名称:doma,代码行数:5,代码来源:MapStreamHandler.java

示例12: createSelectCommand

import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
/**
 * {@link Select} に対応したコマンドを作成します。
 * 
 * @param <RESULT>
 *            検索結果の型
 * @param method
 *            Dao メソッド
 * @param query
 *            クエリ
 * @param resultSetHandler
 *            結果セットのハンドラ
 * @return コマンド
 */
default <RESULT> SelectCommand<RESULT> createSelectCommand(Method method,
        SelectQuery query, ResultSetHandler<RESULT> resultSetHandler) {
    return new SelectCommand<>(query, resultSetHandler);
}
 
开发者ID:domaframework,项目名称:doma,代码行数:18,代码来源:CommandImplementors.java


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