Index: BasePeer.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/om/peer/BasePeer.java,v
retrieving revision 1.4
diff -u -r1.4 BasePeer.java
--- BasePeer.java	12 Oct 2001 22:35:11 -0000	1.4
+++ BasePeer.java	20 Feb 2002 17:22:08 -0000
@@ -925,6 +925,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('(');
@@ -1013,6 +1019,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);
@@ -1064,6 +1082,13 @@
             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).
@@ -1989,6 +2014,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('(');
@@ -2074,6 +2105,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);
@@ -2125,6 +2168,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).
