Author: doogie
Date: Fri Nov 13 05:39:11 2009
New Revision: 835748
URL:
http://svn.apache.org/viewvc?rev=835748&view=revLog:
Create a method to parse stand-alone conditions.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/SQLUtil.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj?rev=835748&r1=835747&r2=835748&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj Fri Nov 13 05:39:11 2009
@@ -397,6 +397,12 @@
| s=SQuoted() { return s; }
}
+public EntityCondition EntityCondition():
+{ EntityCondition ec; }
+{
+ ec=ConditionExpression() <EOF> { return ec; }
+}
+
private EntityCondition ConditionExpression():
{ EntityCondition ec; }
{
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/SQLUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/SQLUtil.java?rev=835748&r1=835747&r2=835748&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/SQLUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/SQLUtil.java Fri Nov 13 05:39:11 2009
@@ -20,8 +20,14 @@
import java.io.StringReader;
+import org.ofbiz.entity.condition.EntityCondition;
+
public class SQLUtil {
public static SQLSelect parseSelect(String sql) throws ParseException {
return new Parser(new StringReader(sql)).Select();
}
+
+ public static EntityCondition parseCondition(String condition) throws ParseException {
+ return new Parser(new StringReader(condition)).EntityCondition();
+ }
}