Index: BasePeer.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/util/BasePeer.java,v
retrieving revision 1.22
diff -u -r1.22 BasePeer.java
--- BasePeer.java	26 Jan 2002 02:32:29 -0000	1.22
+++ BasePeer.java	20 Feb 2002 17:31:44 -0000
@@ -971,6 +971,12 @@
         for (int i=0; i<select.size(); i++)
         {
             String columnName = select.get(i);
+            if (columnName.indexOf('.') == -1)
+            {
+                throw new Exception("malformed column name in Criteria select: '"
+                                    + columnName
+                                    + "' is not of the form 'table.column'");
+            }
             String tableName = null;
             selectClause.add(columnName);
             int parenPos = columnName.indexOf('(');
@@ -1060,6 +1066,18 @@
             {
                 String join1 = (String)join.get(i);
                 String join2 = (String)criteria.getJoinR().get(i);
+                if (join1.indexOf('.') == -1)
+                {
+                    throw new Exception("malformed column name in Criteria join: '"
+                                        + join1
+                                        + "' is not of the form 'table.column'");
+                }
+                if (join2.indexOf('.') == -1)
+                {
+                    throw new Exception("malformed column name in Criteria join: '"
+                                        + join2
+                                        + "' is not of the form 'table.column'");
+                }
 
                 String tableName = join1.substring(0, join1.indexOf('.'));
                 String table = criteria.getTableForAlias(tableName);
@@ -1111,6 +1129,12 @@
             for (int i=0; i<orderBy.size(); i++)
             {
                 String orderByColumn = orderBy.get(i);
+                if (orderByColumn.indexOf('.') == -1)
+                {
+                    throw new Exception("malformed column name in Criteria order by: '"
+                                        + orderByColumn
+                                        + "' is not of the form 'table.column'");
+                }
                 String table = orderByColumn.substring(0,orderByColumn.indexOf('.') );
                 // See if there's a space (between the column list and sort
                 // order in ORDER BY table.column DESC).
@@ -2096,6 +2120,12 @@
         for (int i=0; i<select.size(); i++)
         {
             String columnName = select.get(i);
+            if (columnName.indexOf('.') == -1)
+            {
+                throw new Exception("malformed column name in Criteria select: '"
+                                    + columnName
+                                    + "' is not of the form 'table.column'");
+            }
             String tableName = null;
             selectClause.add(columnName);
             int parenPos = columnName.indexOf('(');
@@ -2182,6 +2212,18 @@
             {
                 String join1 = (String)join.get(i);
                 String join2 = (String)criteria.getJoinR().get(i);
+                if (join1.indexOf('.') == -1)
+                {
+                    throw new Exception("malformed column name in Criteria join: '"
+                                        + join1
+                                        + "' is not of the form 'table.column'");
+                }
+                if (join2.indexOf('.') == -1)
+                {
+                    throw new Exception("malformed column name in Criteria join: '"
+                                        + join2
+                                        + "' is not of the form 'table.column'");
+                }
 
                 String tableName = join1.substring(0, join1.indexOf('.'));
                 String table = criteria.getTableForAlias(tableName);
@@ -2233,6 +2275,12 @@
             for (int i=0; i<orderBy.size(); i++)
             {
                 String orderByColumn = orderBy.get(i);
+                if (orderByColumn.indexOf('.') == -1)
+                {
+                    throw new Exception("malformed column name in Criteria order by: '"
+                                        + orderByColumn
+                                        + "' is not of the form 'table.column'");
+                }
                 String table = orderByColumn.substring(0,orderByColumn.indexOf('.') );
                 // See if there's a space (between the column list and sort
                 // order in ORDER BY table.column DESC).
