Merge of (#10878) to Vaadin 7.

Ensure unique ordering when using TableQuery with multiple primary key
columns.

Change-Id: I9145717d1658393b19a2bca27ac211cad075fc27