本文整理汇总了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();
}
}
示例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;
}
示例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++;
}
示例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;
}
示例5: handle
import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
Supplier<RESULT> handle(ResultSet resultSet, SelectQuery query,
ResultSetRowIndexConsumer consumer) throws SQLException;
示例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);
}
示例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);
}
示例8: createObjectProvider
import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
protected abstract ObjectProvider<TARGET> createObjectProvider(
SelectQuery query);
示例9: createObjectProvider
import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
protected ScalarProvider<BASIC, CONTAINER> createObjectProvider(
SelectQuery query) {
return new ScalarProvider<>(supplier, query);
}
示例10: createObjectProvider
import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
protected ObjectProvider<ENTITY> createObjectProvider(SelectQuery query) {
return new EntityProvider<>(entityType, query,
query.isResultMappingEnsured());
}
示例11: createObjectProvider
import org.seasar.doma.jdbc.query.SelectQuery; //导入依赖的package包/类
@Override
protected MapProvider createObjectProvider(SelectQuery query) {
return new MapProvider(query, mapKeyNamingType);
}
示例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);
}