use of io.shardingjdbc.core.merger.dql.pagination.LimitDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildGroupByStreamMergedResultWithMySQLLimit.
@Test
public void assertBuildGroupByStreamMergedResultWithMySQLLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.MySQL));
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(LimitDecoratorMergedResult.class));
assertThat(((LimitDecoratorMergedResult) actual).getMergedResult(), instanceOf(GroupByStreamMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.LimitDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildOrderByStreamMergedResultWithMySQLLimit.
@Test
public void assertBuildOrderByStreamMergedResultWithMySQLLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.MySQL));
selectStatement.getOrderByItems().add(new OrderItem(1, OrderDirection.DESC, OrderDirection.ASC));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(LimitDecoratorMergedResult.class));
assertThat(((LimitDecoratorMergedResult) actual).getMergedResult(), instanceOf(OrderByStreamMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.LimitDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildGroupByMemoryMergedResultWithAggregationOnlyWithMySQLLimit.
@Test
public void assertBuildGroupByMemoryMergedResultWithAggregationOnlyWithMySQLLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.MySQL));
selectStatement.getItems().add(new AggregationSelectItem(AggregationType.COUNT, "(*)", Optional.<String>absent()));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(LimitDecoratorMergedResult.class));
assertThat(((LimitDecoratorMergedResult) actual).getMergedResult(), instanceOf(GroupByMemoryMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.LimitDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildIteratorStreamMergedResultWithMySQLLimit.
@Test
public void assertBuildIteratorStreamMergedResultWithMySQLLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.MySQL));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(LimitDecoratorMergedResult.class));
assertThat(((LimitDecoratorMergedResult) actual).getMergedResult(), instanceOf(IteratorStreamMergedResult.class));
}
use of io.shardingjdbc.core.merger.dql.pagination.LimitDecoratorMergedResult in project sharding-jdbc by shardingjdbc.
the class DQLMergeEngineTest method assertBuildGroupByMemoryMergedResultWithMySQLLimit.
@Test
public void assertBuildGroupByMemoryMergedResultWithMySQLLimit() throws SQLException {
selectStatement.setLimit(new Limit(DatabaseType.MySQL));
selectStatement.getGroupByItems().add(new OrderItem(1, OrderDirection.DESC, OrderDirection.ASC));
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertThat(actual, instanceOf(LimitDecoratorMergedResult.class));
assertThat(((LimitDecoratorMergedResult) actual).getMergedResult(), instanceOf(GroupByMemoryMergedResult.class));
}
Aggregations