From 0a0d7a6273638567964f92ec827bf212610a520d Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Fri, 1 Feb 2013 17:06:55 +0200 Subject: Merge of (#10878) to Vaadin 7. Ensure unique ordering when using TableQuery with multiple primary key columns. Change-Id: I9145717d1658393b19a2bca27ac211cad075fc27 --- server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/src/com/vaadin/data') diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java b/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java index eba8b652af..4d60a8cc17 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java @@ -159,7 +159,9 @@ public class TableQuery implements QueryDelegate, */ if (orderBys == null || orderBys.isEmpty()) { List ob = new ArrayList(); - ob.add(new OrderBy(primaryKeyColumns.get(0), true)); + for (int i = 0; i < primaryKeyColumns.size(); i++) { + ob.add(new OrderBy(primaryKeyColumns.get(i), true)); + } sh = sqlGenerator.generateSelectQuery(tableName, filters, ob, offset, pagelength, null); } else { -- cgit v1.2.3