commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject cvs commit: jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/sql StorageBeanBase.java
Date Mon, 09 Sep 2002 20:37:05 GMT
husted      2002/09/09 13:37:05

  Modified:    scaffold/src/java/org/apache/commons/scaffold/sql
                        StorageBeanBase.java
  Log:
  + Add isNew() to StorageBean, StorageBeanBase.
  
  Revision  Changes    Path
  1.7       +20 -20    jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/sql/StorageBeanBase.java
  
  Index: StorageBeanBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/sql/StorageBeanBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StorageBeanBase.java	6 Sep 2002 21:47:16 -0000	1.6
  +++ StorageBeanBase.java	9 Sep 2002 20:37:05 -0000	1.7
  @@ -30,7 +30,7 @@
   import org.apache.commons.scaffold.util.ProcessResultBase;
   
   
  -// --------------------------------------------------------------------
  +// ------------------------------------------------------------------------ 78
   
   /**
    * Implements StorageBean interface using
  @@ -107,7 +107,7 @@
   public class StorageBeanBase extends ProcessBeanBase implements StorageBean {
   
   
  -// ----------------------------------------------------------- Commands
  +// ------------------------------------------------------------------ Commands
   // TODO: Refactor this to use a CommandStore
   
   
  @@ -177,8 +177,7 @@
       }
   
   
  -// ---------------------------------------- Base Properties
  -
  +// ----------------------------------------------------------- Base Properties
   
       /**
        * [:TODO: Javadoc]
  @@ -302,7 +301,7 @@
       }
   
   
  -// ----------------------------------------------------- Public Methods
  +// ------------------------------------------------------------ Public Methods
   
   
           // See inteface for JavaDoc
  @@ -315,7 +314,7 @@
       } // end populate
   
   
  -// ----------------------------------------------------- Create Methods
  +// ------------------------------------------------------------ Create Methods
   
   
           // See inteface for JavaDoc
  @@ -335,7 +334,7 @@
       } // end executeUpdate
   
   
  -// -------------------------------------------------- Retrieval Methods
  +// --------------------------------------------------------------------- Retrieval Methods
   
   
           // See inteface for JavaDoc
  @@ -453,7 +452,7 @@
       } // end findByProperty
   
   
  -// ======================================================== UD Methods
  +// ================================================================ UD Methods
   
       /**
        * A storage location for the primaryKey object.
  @@ -476,7 +475,6 @@
           this.primaryKey = primaryKey;
       }
   
  -
       /**
        * The timestamp of the last edit.
        * <p>
  @@ -615,8 +613,7 @@
       }
   
   
  -// ------------------------------------------------------------- store
  -
  +// --------------------------------------------------------------------- store
   
       /**
        * [:TODO: Javadoc]
  @@ -631,6 +628,12 @@
   
   
           // See inteface for JavaDoc
  +    public boolean isNew() {
  +        return (null==getPrimaryKey());
  +    }
  +
  +
  +        // See inteface for JavaDoc
           // @todo Refactor to use fixed-length high/low String as key.
       public Object createKey(String keyName)
               throws ResourceException {
  @@ -670,8 +673,7 @@
           // UPDATE The name of the delete command
       public void store() throws Exception {
   
  -        Object key = getPrimaryKey();
  -        boolean isInsert = (null==key);
  +        boolean isInsert = isNew();
           if (isInsert) allocateKey();
   
           String command = null;
  @@ -730,8 +732,7 @@
       }
   
   
  -// ---------------------------------------------------------- retrieve
  -
  +// ------------------------------------------------------------------ retrieve
   
           // see interface for Javadoc
       public void retrieve() throws Exception {
  @@ -777,7 +778,7 @@
       } // end retrieve
   
   
  -// ------------------------------------------------------------ delete
  +// -------------------------------------------------------------------- delete
   
   
           // see interface for Javadoc
  @@ -834,7 +835,7 @@
       } // end delete
   
   
  -// ------------------------------------------------------------ recycle
  +// -------------------------------------------------------------------- recycle
   
   
           // see interface for Javadoc
  @@ -889,8 +890,7 @@
       } // end recycle
   
   
  -// ---------------------------------------------------------- restore
  -
  +// ------------------------------------------------------------------- restore
   
       /**
        * Unmark entry for deletion.
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message