當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。