db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henn...@apache.org
Subject cvs commit: db-torque/src/java/org/apache/torque/util BasePeer.java
Date Fri, 03 Dec 2004 18:38:40 GMT
henning     2004/12/03 10:38:40

  Modified:    src/java/org/apache/torque/util Tag: TORQUE_3_1_BRANCH
                        BasePeer.java
  Log:
  keyGen can be null, so check before dereferencing...
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.76.2.9  +3 -3      db-torque/src/java/org/apache/torque/util/BasePeer.java
  
  Index: BasePeer.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/util/BasePeer.java,v
  retrieving revision 1.76.2.8
  retrieving revision 1.76.2.9
  diff -u -r1.76.2.8 -r1.76.2.9
  --- BasePeer.java	1 Dec 2004 15:29:10 -0000	1.76.2.8
  +++ BasePeer.java	3 Dec 2004 18:38:40 -0000	1.76.2.9
  @@ -486,7 +486,7 @@
   
           // If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id
           // before the insert.
  -        if (keyGen.isPriorToInsert())
  +        if (keyGen != null && keyGen.isPriorToInsert())
           {
               // pk will be null if there is no primary key defined for the table
               // we're inserting into.
  @@ -522,7 +522,7 @@
   
           // If the primary key column is auto-incremented, get the id
           // now.
  -        if (keyGen.isPostInsert())
  +        if (keyGen != null && keyGen.isPostInsert())
           {
               id = getId(pk, keyGen, con, keyInfo);
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message