private static Set<ColumnValues> getPksFromQuery(IDatabaseConnection connection, String table, String query)
throws DataSetException, SQLException {
Set<ColumnValues> ret = new HashSet<ColumnValues>();
IDataSet data = connection.createDataSet(new String[] { table });
Column[] tablePks = data.getTableMetaData(table).getPrimaryKeys();
String pkName = tablePks[0].getColumnName();
if (query == null) {
query = "SELECT " + pkName + " FROM " + table;
}