db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/xdocs tutorial3.xml sequencemanager.xml
Date Wed, 07 May 2003 21:32:49 GMT
arminw      2003/05/07 14:32:49

  Modified:    xdocs    tutorial3.xml sequencemanager.xml
  Log:
  - update PersistenceBrokerAware section
  - clarification of seqMan impl
  
  Revision  Changes    Path
  1.20      +60 -44    db-ojb/xdocs/tutorial3.xml
  
  Index: tutorial3.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/tutorial3.xml,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- tutorial3.xml	9 Apr 2003 09:28:18 -0000	1.19
  +++ tutorial3.xml	7 May 2003 21:32:49 -0000	1.20
  @@ -1694,36 +1694,59 @@
   <source><![CDATA[
   public interface PersistenceBrokerAware
   {
  - 	/**
  - 	 * this method is called as the first operation within a call to
  - 	 * PersistenceBroker.store(PersistenceBrokerAware instance).
  - 	 */
  -    public void beforeStore() throws PersistenceBrokerException;
  -
  - 	/**
  - 	 * this method is called as the last operation within a call to
  - 	 * PersistenceBroker.store(PersistenceBrokerAware instance).
  - 	 */
  -    public void afterStore() throws PersistenceBrokerException;
  -
  -  	/**
  - 	 * this method is called as the first operation within a call to
  - 	 * PersistenceBroker.delete(PersistenceBrokerAware instance).
  - 	 */
  -    public void beforeDelete() throws PersistenceBrokerException;
  -
  - 	/**
  - 	 * this method is called as the last operation within a call to
  - 	 * PersistenceBroker.delete(PersistenceBrokerAware instance).
  - 	 */
  -    public void afterDelete() throws PersistenceBrokerException;
  -
  - 	/**
  - 	 * this method is called as the last operation within a call to
  - 	 * PersistenceBroker.getObjectByXXX() or
  - 	 * PersistenceBroker.getCollectionByXXX().
  - 	 */
  -    public void afterLookup() throws PersistenceBrokerException;
  +    /**
  +     * this method is called as the first operation within a call to
  +     * PersistenceBroker.store(Object pbAwareObject), if
  +     * the persistent object needs insert.
  +     */
  +    public void beforeInsert(PersistenceBroker broker)
  +                        throws PersistenceBrokerException;
  +
  +    /**
  +     * this method is called as the last operation within a call to
  +     * PersistenceBroker.store(Object pbAwareObject), if
  +     * the persistent object needs insert.
  +     */
  +    public void afterInsert(PersistenceBroker broker)
  +                        throws PersistenceBrokerException;
  +
  +    /**
  +     * this method is called as the first operation within a call to
  +     * PersistenceBroker.store(Object pbAwareObject), if
  +     * the persistent object needs update.
  +     */
  +    public void beforeUpdate(PersistenceBroker broker)
  +                        throws PersistenceBrokerException;
  +
  +    /**
  +     * this method is called as the last operation within a call to
  +     * PersistenceBroker.store(Object pbAwareObject), if
  +     * the persistent object needs update.
  +     */
  +    public void afterUpdate(PersistenceBroker broker)
  +                        throws PersistenceBrokerException;
  +
  +    /**
  +     * this method is called as the first operation within a call to
  +     * PersistenceBroker.delete(Object pbAwareObject).
  +     */
  +    public void beforeDelete(PersistenceBroker broker)
  +                        throws PersistenceBrokerException;
  +
  +    /**
  +     * this method is called as the last operation within a call to
  +     * PersistenceBroker.delete(Object pbAwareObject).
  +     */
  +    public void afterDelete(PersistenceBroker broker)
  +                        throws PersistenceBrokerException;
  +
  +    /**
  +     * this method is called as the last operation within a call to
  +     * PersistenceBroker.getObjectByXXX() or
  +     * PersistenceBroker.getCollectionByXXX().
  +     */
  +    public void afterLookup(PersistenceBroker broker)
  +                        throws PersistenceBrokerException;
   }
   ]]></source>
   
  @@ -1740,7 +1763,7 @@
   			provide empty implementations for all required mthods.
   		</li>
   		<li>
  -			implement the method <code>afterStore()</code> to perform
  +			implement the method <code>afterStore(PersistenceBroker broker)</code> to
perform
   			your intended logic.
   		</li>
   	</ol>
  @@ -1752,7 +1775,7 @@
   	<br/>
   	When the broker is storing such an instance the DB assigns an autoincrement
   	value to the primary key column mapped to the attribute <code>m_id</code>.
  -	The <code>.afterStore()</code> instance callback is used to update
  +	The <code>afterStore(PersistenceBroker broker)</code> instance callback is
used to update
   	the the attribute <code>m_id</code> with this value.
   </p>
   
  @@ -1762,11 +1785,11 @@
   {
       private static final String ID_ATTRIBUTE_NAME = "m_id";
   
  -    public void afterDelete()
  +    public void afterDelete(PersistenceBroker broker)
       {
       }
   
  -    public void afterLookup()
  +    public void afterLookup(PersistenceBroker broker)
       {
       }
   
  @@ -1775,11 +1798,8 @@
        * autoincremented PK value
        * back into the PK attribute.
        */
  -    public void afterStore()
  +    public void afterStore(PersistenceBroker broker)
       {
  -        PersistenceBroker broker =
  -            PersistenceBrokerFactory.createPersistenceBroker();
  -
           try
           {
               // remove object from cache to ensure we are retrieving a
  @@ -1818,17 +1838,13 @@
                   idField.set(this, idField.get(object));
               }
           }
  -        finally
  -        {
  -            PersistenceBrokerFactory.releaseInstance(broker);
  -        }
       }
   
  -    public void beforeDelete()
  +    public void beforeDelete(PersistenceBroker broker)
       {
       }
   
  -    public void beforeStore()
  +    public void beforeStore(PersistenceBroker broker)
       {
       }
   
  
  
  
  1.11      +4 -0      db-ojb/xdocs/sequencemanager.xml
  
  Index: sequencemanager.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/sequencemanager.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- sequencemanager.xml	11 Apr 2003 21:59:49 -0000	1.10
  +++ sequencemanager.xml	7 May 2003 21:32:49 -0000	1.11
  @@ -232,6 +232,7 @@
   <br/>- do not use when connections were associated with a
   transaction, e.g. when using DataSources from an j2ee conform application server
   <br/>- do not use if other entities use database based sequencing
  +or database will be updated by other applications
   </p>
   
   <br/>
  @@ -265,6 +266,7 @@
   has some Limitations:
   <br/>- do not use in clustered environments
   <br/>- do not use if other entities use database based sequencing
  +or database will be updated by other applications
   </p>
   
   
  @@ -431,6 +433,8 @@
   <p>
   Limitations:
   <br/>- currently none known
  +<br/>(- do not use if database will be updated by other
  +applications)
   </p>
   
   </subsection>
  
  
  

Mime
View raw message