You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/10/27 23:11:07 UTC
cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/util BasePeer.java Criteria.java Query.java SqlExpression.java
jvanzyl 01/10/27 14:11:07
Modified: src/java/org/apache/torque/util BasePeer.java Criteria.java
Query.java SqlExpression.java
Log:
- using StringStack from the commons instead of the internal
StringStackBuffer util.
Revision Changes Path
1.16 +24 -24 jakarta-turbine-torque/src/java/org/apache/torque/util/BasePeer.java
Index: BasePeer.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/util/BasePeer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- BasePeer.java 2001/10/16 03:58:07 1.15
+++ BasePeer.java 2001/10/27 21:11:07 1.16
@@ -95,7 +95,7 @@
import org.apache.torque.util.SqlExpression;
//!! no good.
-import org.apache.torque.util.StringStackBuffer;
+import org.apache.commons.util.StringStack;
import org.apache.torque.TorqueException;
import org.apache.log4j.Category;
@@ -110,7 +110,7 @@
* @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
* @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
* @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
- * @version $Id: BasePeer.java,v 1.15 2001/10/16 03:58:07 dlr Exp $
+ * @version $Id: BasePeer.java,v 1.16 2001/10/27 21:11:07 jvanzyl Exp $
*/
public abstract class BasePeer implements java.io.Serializable
{
@@ -527,8 +527,8 @@
// Set up a list of required tables and add extra entries to
// criteria if directed to delete all related records.
- // StringStackBuffer.add() only adds element if it is unique.
- StringStackBuffer tables = new StringStackBuffer();
+ // StringStack.add() only adds element if it is unique.
+ StringStack tables = new StringStack();
Enumeration e = criteria.keys();
while(e.hasMoreElements())
{
@@ -580,7 +580,7 @@
for (int i=0; i<tables.size(); i++)
{
KeyDef kd = new KeyDef();
- StringStackBuffer whereClause = new StringStackBuffer();
+ StringStack whereClause = new StringStack();
ColumnMap[] columnMaps =
dbMap.getTable( tables.get(i) ).getColumns();
@@ -945,17 +945,17 @@
DB db = Torque.getDB( criteria.getDbName() );
DatabaseMap dbMap = Torque.getDatabaseMap( criteria.getDbName() );
- StringStackBuffer selectModifiers = query.getSelectModifiers();
- StringStackBuffer selectClause = query.getSelectClause();
- StringStackBuffer fromClause = query.getFromClause();
- StringStackBuffer whereClause = query.getWhereClause();
- StringStackBuffer orderByClause = query.getOrderByClause();
+ StringStack selectModifiers = query.getSelectModifiers();
+ StringStack selectClause = query.getSelectClause();
+ StringStack fromClause = query.getFromClause();
+ StringStack whereClause = query.getWhereClause();
+ StringStack orderByClause = query.getOrderByClause();
- StringStackBuffer orderBy = criteria.getOrderByColumns();
+ StringStack orderBy = criteria.getOrderByColumns();
boolean ignoreCase = criteria.isIgnoreCase();
- StringStackBuffer select = criteria.getSelectColumns();
+ StringStack select = criteria.getSelectColumns();
Hashtable aliases = criteria.getAsColumns();
- StringStackBuffer modifiers = criteria.getSelectModifiers();
+ StringStack modifiers = criteria.getSelectModifiers();
for (int i=0; i<modifiers.size(); i++)
{
@@ -1703,9 +1703,9 @@
Torque.getDatabaseMap( selectCriteria.getDbName() );
Connection connection = dbCon.getConnection();
- // Set up a list of required tables. StringStackBuffer.add()
+ // Set up a list of required tables. StringStack.add()
// only adds element if it is unique.
- StringStackBuffer tables = new StringStackBuffer();
+ StringStack tables = new StringStack();
Enumeration e = selectCriteria.keys();
while(e.hasMoreElements())
{
@@ -1715,7 +1715,7 @@
for (int i=0; i<tables.size(); i++)
{
KeyDef kd = new KeyDef();
- StringStackBuffer whereClause = new StringStackBuffer();
+ StringStack whereClause = new StringStack();
DatabaseMap tempDbMap = dbMap;
ColumnMap[] columnMaps =
@@ -2063,17 +2063,17 @@
Query query = new Query();
- StringStackBuffer selectModifiers = query.getSelectModifiers();
- StringStackBuffer selectClause = query.getSelectClause();
- StringStackBuffer fromClause = query.getFromClause();
- StringStackBuffer whereClause = query.getWhereClause();
- StringStackBuffer orderByClause = query.getOrderByClause();
+ StringStack selectModifiers = query.getSelectModifiers();
+ StringStack selectClause = query.getSelectClause();
+ StringStack fromClause = query.getFromClause();
+ StringStack whereClause = query.getWhereClause();
+ StringStack orderByClause = query.getOrderByClause();
- StringStackBuffer orderBy = criteria.getOrderByColumns();
+ StringStack orderBy = criteria.getOrderByColumns();
boolean ignoreCase = criteria.isIgnoreCase();
- StringStackBuffer select = criteria.getSelectColumns();
+ StringStack select = criteria.getSelectColumns();
Hashtable aliases = criteria.getAsColumns();
- StringStackBuffer modifiers = criteria.getSelectModifiers();
+ StringStack modifiers = criteria.getSelectModifiers();
for (int i=0; i<modifiers.size(); i++)
{
1.7 +15 -15 jakarta-turbine-torque/src/java/org/apache/torque/util/Criteria.java
Index: Criteria.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/util/Criteria.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Criteria.java 2001/10/18 19:28:58 1.6
+++ Criteria.java 2001/10/27 21:11:07 1.7
@@ -75,7 +75,7 @@
import org.apache.torque.om.DateKey;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.util.BasePeer;
-import org.apache.torque.util.StringStackBuffer;
+import org.apache.commons.util.StringStack;
/**
* This is a utility class that is used for retrieving different types
@@ -90,7 +90,7 @@
* @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
* @author <a href="mailto:eric@dobbse.net">Eric Dobbs</a>
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
- * @version $Id: Criteria.java,v 1.6 2001/10/18 19:28:58 jmcnally Exp $
+ * @version $Id: Criteria.java,v 1.7 2001/10/27 21:11:07 jvanzyl Exp $
*/
public class Criteria extends Hashtable
{
@@ -190,9 +190,9 @@
private boolean ignoreCase = false;
private boolean singleRecord = false;
private boolean cascade = false;
- private StringStackBuffer selectModifiers = new StringStackBuffer();
- private StringStackBuffer selectColumns = new StringStackBuffer();
- private StringStackBuffer orderByColumns = new StringStackBuffer();
+ private StringStack selectModifiers = new StringStack();
+ private StringStack selectColumns = new StringStack();
+ private StringStack orderByColumns = new StringStack();
private Hashtable asColumns = new Hashtable(8);
private ArrayList joinL = null;
private ArrayList joinR = null;
@@ -397,7 +397,7 @@
}
DatabaseMap map = Torque.getDatabaseMap(databaseMapName);
- StringStackBuffer tables = new StringStackBuffer();
+ StringStack tables = new StringStack();
for (Enumeration e = super.elements(); e.hasMoreElements(); )
{
Criterion co = (Criterion)e.nextElement();
@@ -1750,10 +1750,10 @@
/**
* Get select columns.
*
- * @return A StringStackBuffer with the name of the select
+ * @return A StringStack with the name of the select
* columns.
*/
- public StringStackBuffer getSelectColumns()
+ public StringStack getSelectColumns()
{
return selectColumns;
}
@@ -1761,9 +1761,9 @@
/**
* Get select modifiers.
*
- * @return A StringStackBuffer with the select modifiers.
+ * @return A StringStack with the select modifiers.
*/
- public StringStackBuffer getSelectModifiers()
+ public StringStack getSelectModifiers()
{
return selectModifiers;
}
@@ -1804,9 +1804,9 @@
/**
* Get order by columns.
*
- * @return A StringStackBuffer with the name of the order columns.
+ * @return A StringStack with the name of the order columns.
*/
- public StringStackBuffer getOrderByColumns()
+ public StringStack getOrderByColumns()
{
return orderByColumns;
}
@@ -3535,7 +3535,7 @@
sb.append (field)
.append (comparison);
- StringStackBuffer inClause = new StringStackBuffer();
+ StringStack inClause = new StringStack();
if (value instanceof Vector)
{
@@ -3702,12 +3702,12 @@
public String[] getAllTables()
{
- StringStackBuffer tables = new StringStackBuffer();
+ StringStack tables = new StringStack();
addCriterionTable(this, tables);
return tables.toStringArray();
}
- private void addCriterionTable(Criterion c, StringStackBuffer s)
+ private void addCriterionTable(Criterion c, StringStack s)
{
if ( c != null )
{
1.3 +17 -17 jakarta-turbine-torque/src/java/org/apache/torque/util/Query.java
Index: Query.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/util/Query.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Query.java 2001/08/10 12:23:04 1.2
+++ Query.java 2001/10/27 21:11:07 1.3
@@ -54,7 +54,7 @@
* <http://www.apache.org/>.
*/
-import org.apache.torque.util.StringStackBuffer;
+import org.apache.commons.util.StringStack;
/**
* Used to assemble an SQL SELECT query. Attributes exist for the
@@ -64,7 +64,7 @@
* is used primarily by BasePeer.
*
* @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
- * @version $Id: Query.java,v 1.2 2001/08/10 12:23:04 knielsen Exp $
+ * @version $Id: Query.java,v 1.3 2001/10/27 21:11:07 jvanzyl Exp $
*/
public class Query
{
@@ -79,11 +79,11 @@
private static final String LIMIT = " LIMIT ";
private static final String ROWCOUNT = " SET ROWCOUNT ";
- private StringStackBuffer selectModifiers = new StringStackBuffer();
- private StringStackBuffer selectColumns = new StringStackBuffer();
- private StringStackBuffer fromTables = new StringStackBuffer();
- private StringStackBuffer whereCriteria = new StringStackBuffer();
- private StringStackBuffer orderByColumns = new StringStackBuffer();
+ private StringStack selectModifiers = new StringStack();
+ private StringStack selectColumns = new StringStack();
+ private StringStack fromTables = new StringStack();
+ private StringStack whereCriteria = new StringStack();
+ private StringStack orderByColumns = new StringStack();
private String limit;
private String rowcount;
@@ -91,9 +91,9 @@
* Retrieve the modifier buffer in order to add modifiers to this
* query. E.g. DISTINCT and ALL.
*
- * @return A StringStackBuffer used to add modifiers.
+ * @return A StringStack used to add modifiers.
*/
- public StringStackBuffer getSelectModifiers()
+ public StringStack getSelectModifiers()
{
return selectModifiers;
}
@@ -103,9 +103,9 @@
* are returned in this query.
*
*
- * @return A StringStackBuffer used to add columns to be selected.
+ * @return A StringStack used to add columns to be selected.
*/
- public StringStackBuffer getSelectClause()
+ public StringStack getSelectClause()
{
return selectColumns;
}
@@ -115,10 +115,10 @@
* involved in this query.
*
*
- * @return A StringStackBuffer used to add tables involved in the
+ * @return A StringStack used to add tables involved in the
* query.
*/
- public StringStackBuffer getFromClause()
+ public StringStack getFromClause()
{
return fromTables;
}
@@ -128,9 +128,9 @@
* criteria E.g. column_a=3. Expressions added to the buffer will
* be separated using AND.
*
- * @return A StringStackBuffer used to add selection criteria.
+ * @return A StringStack used to add selection criteria.
*/
- public StringStackBuffer getWhereClause()
+ public StringStack getWhereClause()
{
return whereCriteria;
}
@@ -139,9 +139,9 @@
* Retrieve the order by columns buffer in order to specify which
* columns are used to sort the results of the query.
*
- * @return A StringStackBuffer used to add columns to sort on.
+ * @return A StringStack used to add columns to sort on.
*/
- public StringStackBuffer getOrderByClause()
+ public StringStack getOrderByClause()
{
return orderByColumns;
}
1.9 +3 -3 jakarta-turbine-torque/src/java/org/apache/torque/util/SqlExpression.java
Index: SqlExpression.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/util/SqlExpression.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SqlExpression.java 2001/10/18 19:28:58 1.8
+++ SqlExpression.java 2001/10/27 21:11:07 1.9
@@ -62,7 +62,7 @@
import org.apache.torque.om.DateKey;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.om.StringKey;
-import org.apache.torque.util.StringStackBuffer;
+import org.apache.commons.util.StringStack;
/**
* This class represents a part of an SQL query found in the <code>WHERE</code>
@@ -77,7 +77,7 @@
* @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
* @author <a href="mailto:fedor@apache.org">Fedor Karpelevitch</a>
- * @version $Id: SqlExpression.java,v 1.8 2001/10/18 19:28:58 jmcnally Exp $
+ * @version $Id: SqlExpression.java,v 1.9 2001/10/27 21:11:07 jvanzyl Exp $
*/
public class SqlExpression
{
@@ -517,7 +517,7 @@
}
whereClause.append(comparison);
- StringStackBuffer inClause = new StringStackBuffer();
+ StringStack inClause = new StringStack();
if (criteria instanceof List)
{
Iterator iter = ((List)criteria).iterator();
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org