Author: dan.j.allen
Date: 2008-10-11 01:37:34 -0400 (Sat, 11 Oct 2008)
New Revision: 9258
Modified:
trunk/src/main/org/jboss/seam/framework/Query.java
Log:
allow sort column to be a property path (necessary to allow sorting on components and
ToOne associations)
Modified: trunk/src/main/org/jboss/seam/framework/Query.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/Query.java 2008-10-10 19:49:54 UTC (rev 9257)
+++ trunk/src/main/org/jboss/seam/framework/Query.java 2008-10-11 05:37:34 UTC (rev 9258)
@@ -32,7 +32,7 @@
private static final Pattern WHERE_PATTERN =
Pattern.compile("\\s(where)\\s", Pattern.CASE_INSENSITIVE);
private static final Pattern ORDER_PATTERN =
Pattern.compile("\\s(order)(\\s)+by\\s", Pattern.CASE_INSENSITIVE);
- private static final Pattern ORDER_COLUMN_PATTERN =
Pattern.compile("^\\w*$");
+ private static final Pattern ORDER_COLUMN_PATTERN =
Pattern.compile("^\\w+(\\.\\w+)*$");
private static final String DIR_ASC = "asc";
private static final String DIR_DESC = "desc";
@@ -411,12 +411,10 @@
*/
public String getOrder() {
- String column = getOrderColumn();
+ String column = getOrderColumn();
if (column == null) {
return order;
-
-
}
String direction = getOrderDirection();
Show replies by date