@Test public void testTOPQuery() throws Exception { String sql = db.getSelectStatement("database.tablename", "some(set),of(columns),that,might,contain,methods,a.*", "", "", 100L, null); String expected1 = "SELECT TOP 100 some(set),of(columns),that,might,contain,methods,a.* FROM database.tablename"; Assert.assertEquals(expected1, sql); sql = db.getSelectStatement("database.tablename", "some(set),of(columns),that,might,contain,methods,a.*", "", "contain", 100L, null); String expected2 = "SELECT TOP 100 some(set),of(columns),that,might,contain,methods,a.* FROM database.tablename ORDER BY contain"; Assert.assertEquals(expected2, sql); sql = db.getSelectStatement("database.tablename", "", "that=\'some\"\' value\'", "might DESC", 123456L, null); String expected4 = "SELECT TOP 123456 * FROM database.tablename WHERE that=\'some\"\' value\' ORDER BY might DESC"; Assert.assertEquals(expected4, sql); }
@Override public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset) { return getSelectStatement(tableName, columnNames, whereClause, orderByClause, limit, offset, null); }
MSSQL2008DatabaseAdapter extends MSSQLDatabaseAdapter { @Override public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset) { return getSelectStatement(tableName, columnNames, whereClause, orderByClause, limit, offset, null); } }
MSSQL2008DatabaseAdapter extends MSSQLDatabaseAdapter { @Override public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset) { return getSelectStatement(tableName, columnNames, whereClause, orderByClause, limit, offset, null); }  }
MSSQL2008DatabaseAdapter extends MSSQLDatabaseAdapter { @Override public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset) { return getSelectStatement(tableName, columnNames, whereClause, orderByClause, limit, offset, null); }  @Override String getName(); @Override String getDescription(); @Override String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset); @Override String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset, String columnForPartitioning); }
MSSQL2008DatabaseAdapter extends MSSQLDatabaseAdapter { @Override public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset) { return getSelectStatement(tableName, columnNames, whereClause, orderByClause, limit, offset, null); }  @Override String getName(); @Override String getDescription(); @Override String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset); @Override String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset, String columnForPartitioning);  }