Login  Register

svn commit: r881032 - in /ofbiz/trunk/framework/sql/src/org/ofbiz/sql: ListValue.java SQLInsert.java SQLUpdate.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

svn commit: r881032 - in /ofbiz/trunk/framework/sql/src/org/ofbiz/sql: ListValue.java SQLInsert.java SQLUpdate.java

doogie-3
2163 posts
Author: doogie
Date: Mon Nov 16 23:06:56 2009
New Revision: 881032

URL: http://svn.apache.org/viewvc?rev=881032&view=rev
Log:
Expost various properties in a standard way.

Modified:
    ofbiz/trunk/framework/sql/src/org/ofbiz/sql/ListValue.java
    ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLInsert.java
    ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLUpdate.java

Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/ListValue.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/ListValue.java?rev=881032&r1=881031&r2=881032&view=diff
==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/ListValue.java (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/ListValue.java Mon Nov 16 23:06:56 2009
@@ -18,17 +18,22 @@
  */
 package org.ofbiz.sql;
 
+import java.util.Iterator;
 import java.util.List;
 
 import org.ofbiz.base.util.StringUtil;
 
-public final class ListValue extends Value {
+public final class ListValue extends Value implements Iterable<Value> {
     private final List<Value> values;
 
     public ListValue(List<Value> values) {
         this.values = values;
     }
 
+    public Iterator<Value> iterator() {
+        return values.iterator();
+    }
+
     public StringBuilder appendTo(StringBuilder sb) {
         sb.append('(');
         StringUtil.appendTo(sb, values, null, null, ", ");

Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLInsert.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLInsert.java?rev=881032&r1=881031&r2=881032&view=diff
==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLInsert.java (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLInsert.java Mon Nov 16 23:06:56 2009
@@ -18,6 +18,7 @@
  */
 package org.ofbiz.sql;
 
+import java.util.Iterator;
 import java.util.List;
 
 import org.ofbiz.base.util.StringUtil;
@@ -39,6 +40,18 @@
         return (PP) planner.plan(this);
     }
 
+    public TableName getTableName() {
+        return tableName;
+    }
+
+    public InsertSource getSource() {
+        return source;
+    }
+
+    public Iterator<String> iterator() {
+        return columns.iterator();
+    }
+
     public StringBuilder appendTo(StringBuilder sb) {
         sb.append("INSERT INTO ");
         tableName.appendTo(sb);

Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLUpdate.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLUpdate.java?rev=881032&r1=881031&r2=881032&view=diff
==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLUpdate.java (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLUpdate.java Mon Nov 16 23:06:56 2009
@@ -23,7 +23,7 @@
 
 import org.ofbiz.base.util.StringUtil;
 
-public final class SQLUpdate<P extends UpdatePlan<P>> extends SQLStatement<SQLUpdate<P>, P> {
+public final class SQLUpdate<P extends UpdatePlan<P>> extends SQLStatement<SQLUpdate<P>, P> implements Iterable<SetField> {
     private final Table table;
     private final List<SetField> setFields;
     private final Condition whereCondition;
@@ -43,8 +43,8 @@
         return table;
     }
 
-    public List<SetField> getSetFields() {
-        return setFields;
+    public Iterator<SetField> iterator() {
+        return setFields.iterator();
     }
 
     public Condition getWhereCondition() {