Author: smendenh(a)redhat.com
Date: 2010-01-21 16:17:58 -0500 (Thu, 21 Jan 2010)
New Revision: 11979
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/framework/Query.java
Log:
Resolved
https://jira.jboss.org/jira/browse/JBSEAM-4087 per SUBJECT_PATTERN provided in
JIRA, passes all tests in QueryTest
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/framework/Query.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/framework/Query.java 2010-01-21
14:52:47 UTC (rev 11978)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/framework/Query.java 2010-01-21
21:17:58 UTC (rev 11979)
@@ -28,7 +28,7 @@
public abstract class Query<T, E>
extends PersistenceController<T> //TODO: extend MutableController!
{
- private static final Pattern SUBJECT_PATTERN = Pattern.compile("^select
(\\w+((\\s+|\\.)\\w+)*)\\s+from", Pattern.CASE_INSENSITIVE);
+ private static final Pattern SUBJECT_PATTERN =
Pattern.compile("^select\\s+(\\w+(?:\\s*\\.\\s*\\w+)*?)(?:\\s*,\\s*(\\w+(?:\\s*\\.\\s*\\w+)*?))*?\\s+from",
Pattern.CASE_INSENSITIVE);
private static final Pattern FROM_PATTERN =
Pattern.compile("(^|\\s)(from)\\s", Pattern.CASE_INSENSITIVE);
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);