use of io.shardingjdbc.core.merger.dql.pagination.RowNumberDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildGroupByStreamMergedResultWithOracleLimit.
@Test
public void assertBuildGroupByStreamMergedResultWithOracleLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.Oracle));
selectStatement.getGroupByItems().add(new OrderItem(1, OrderDirection.DESC, OrderDirection.ASC));
selectStatement.getOrderByItems().add(new OrderItem(1, OrderDirection.DESC, OrderDirection.ASC));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(RowNumberDecoratorMergedResult.class));
assertThat(((RowNumberDecoratorMergedResult) actual).getMergedResult(), instanceOf(GroupByStreamMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.RowNumberDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildOrderByStreamMergedResultWithOracleLimit.
@Test
public void assertBuildOrderByStreamMergedResultWithOracleLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.Oracle));
selectStatement.getOrderByItems().add(new OrderItem(1, OrderDirection.DESC, OrderDirection.ASC));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(RowNumberDecoratorMergedResult.class));
assertThat(((RowNumberDecoratorMergedResult) actual).getMergedResult(), instanceOf(OrderByStreamMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.RowNumberDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildGroupByMemoryMergedResultWithAggregationOnlyWithOracleLimit.
@Test
public void assertBuildGroupByMemoryMergedResultWithAggregationOnlyWithOracleLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.Oracle));
selectStatement.getItems().add(new AggregationSelectItem(AggregationType.COUNT, "(*)", Optional.<String>absent()));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(RowNumberDecoratorMergedResult.class));
assertThat(((RowNumberDecoratorMergedResult) actual).getMergedResult(), instanceOf(GroupByMemoryMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.RowNumberDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildIteratorStreamMergedResultWithOracleLimit.
@Test
public void assertBuildIteratorStreamMergedResultWithOracleLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.Oracle));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(RowNumberDecoratorMergedResult.class));
assertThat(((RowNumberDecoratorMergedResult) actual).getMergedResult(), instanceOf(IteratorStreamMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.RowNumberDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildGroupByMemoryMergedResultWithOracleLimit.
@Test
public void assertBuildGroupByMemoryMergedResultWithOracleLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.Oracle));
selectStatement.getGroupByItems().add(new OrderItem(1, OrderDirection.DESC, OrderDirection.ASC));
selectStatement.getOrderByItems().add(new OrderItem(2, OrderDirection.DESC, OrderDirection.ASC));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(RowNumberDecoratorMergedResult.class));
assertThat(((RowNumberDecoratorMergedResult) actual).getMergedResult(), instanceOf(GroupByMemoryMergedResult.class));
}
Aggregations