diff options
author | Anna Koskinen <anna@vaadin.com> | 2013-02-01 17:06:55 +0200 |
---|---|---|
committer | Anna Koskinen <anna@vaadin.com> | 2013-02-05 16:44:59 +0200 |
commit | 0a0d7a6273638567964f92ec827bf212610a520d (patch) | |
tree | 91cb1e5115003b7f0f80bc0b9064df9773993145 /server/src/com/vaadin/data | |
parent | 1431139cb24af12edc6685a2841460a0d4dd03b9 (diff) | |
download | vaadin-framework-0a0d7a6273638567964f92ec827bf212610a520d.tar.gz vaadin-framework-0a0d7a6273638567964f92ec827bf212610a520d.zip |
Merge of (#10878) to Vaadin 7.
Ensure unique ordering when using TableQuery with multiple primary key
columns.
Change-Id: I9145717d1658393b19a2bca27ac211cad075fc27
Diffstat (limited to 'server/src/com/vaadin/data')
-rw-r--r-- | server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java | 4 |
1 files changed, 3 insertions, 1 deletions
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<OrderBy> ob = new ArrayList<OrderBy>(); - 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 { |