db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/generator/src/java/org/apache/torque/engine/database/model Database.java
Date Tue, 08 Apr 2003 21:17:06 GMT
mpoeschl    2003/04/08 14:17:05

  Modified:    xdocs    changes.xml
               src/generator/src/java/org/apache/torque/engine/database/model
                        Database.java
  Log:
  TRQS116: Database.java NPEs on bad foreign key
  
  Revision  Changes    Path
  1.73      +3 -0      db-torque/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/xdocs/changes.xml,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- changes.xml	7 Apr 2003 20:50:22 -0000	1.72
  +++ changes.xml	8 Apr 2003 21:17:05 -0000	1.73
  @@ -89,6 +89,9 @@
         TRQS104: Use of null Object
       </li>
       <li>
  +      TRQS116: Database.java NPEs on bad foreign key
  +    </li>
  +    <li>
         TRQS118: Generated OM doesn't compile when using FLOAT as primary key
       </li>
       <li>
  
  
  
  1.3       +6 -5      db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Database.java
  
  Index: Database.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Database.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Database.java	18 Feb 2003 10:08:10 -0000	1.2
  +++ Database.java	8 Apr 2003 21:17:05 -0000	1.3
  @@ -472,15 +472,16 @@
                           = currFK.getForeignColumns().iterator();
                   while (foreignColumnNames.hasNext())
                   {
  -                    Column foreign = foreignTable
  -                        .getColumn((String) foreignColumnNames.next());
  +                    String foreignColumnName = (String) foreignColumnNames.next();
  +                    Column foreign = foreignTable.getColumn(foreignColumnName);
                       // if the foreign column does not exist, we may have an
                       // external reference or a misspelling
                       if (foreign == null)
                       {
                           System.out.println("ERROR!! Attempt to set foreign"
  -                                + " key to nonexistent column in table, "
  -                                + foreignTable.getName() + "!");
  +                                + " key to nonexistent column: table="
  +                                +  currTable.getName() + ", foreign column=" 
  +                                +  foreignColumnName + "!");
                       }
                       foreign.addReferrer(currFK);
                   }
  
  
  

Mime
View raw message