use of io.shardingjdbc.core.merger.MergedResult in project sharding-jdbc by shardingjdbc.
the class RowNumberDecoratorMergedResultTest method assertNextForRowCountBoundOpenedFalse.
@Test
public void assertNextForRowCountBoundOpenedFalse() throws SQLException {
Limit limit = new Limit(DatabaseType.Oracle);
limit.setOffset(new LimitValue(2, -1, true));
limit.setRowCount(new LimitValue(4, -1, false));
selectStatement.setLimit(limit);
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertTrue(actual.next());
assertTrue(actual.next());
assertFalse(actual.next());
}
use of io.shardingjdbc.core.merger.MergedResult in project sharding-jdbc by shardingjdbc.
the class TopAndRowNumberDecoratorMergedResultTest method assertNextWithOffsetBoundOpenedFalse.
@Test
public void assertNextWithOffsetBoundOpenedFalse() throws SQLException {
Limit limit = new Limit(DatabaseType.SQLServer);
limit.setOffset(new LimitValue(2, -1, false));
limit.setRowCount(new LimitValue(4, -1, false));
selectStatement.setLimit(limit);
mergeEngine = new DQLMergeEngine(queryResults, selectStatement);
MergedResult actual = mergeEngine.merge();
assertTrue(actual.next());
assertTrue(actual.next());
assertFalse(actual.next());
}
Aggregations