Clover coverage report - Replica - 1.0-Alpha
Coverage timestamp: Dom Fev 1 2004 17:00:58 WET
file stats: LOC: 80   Methods: 5
NCLOC: 42   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ValueChangeReservationUse.java 0% 0% 0% 0%
coverage
 1   
 package mobisnap.common.reservation;
 2   
 
 3   
 /**
 4   
  * Used to represent the usage of a value-change reservation
 5   
  * 
 6   
  * @version 5-Apr-2001
 7   
  * @author 
 8   
  */
 9   
 public class ValueChangeReservationUse
 10   
     extends ReservationUseBase
 11   
     implements java.io.Serializable
 12   
 {
 13  0
     public ValueChangeReservationUse( ValueChangeReservation rsrv) {
 14  0
         super( rsrv);
 15   
     }
 16   
     
 17   
     /**
 18   
      * The associated transaction has been committed. Updates the associated
 19   
      * reservation accordingly.
 20   
      * Returns true if the reservation has been completely used
 21   
      */
 22  0
     public boolean commitCltRsrv() throws Exception {
 23  0
         return false;
 24   
     }
 25   
 
 26   
     /**
 27   
      * The associated transaction has been rollbacked. Updates the associated
 28   
      * reservation accordingly.
 29   
      */
 30  0
     public void rollbackCltRsrv(){
 31   
         // do nothing
 32   
     }
 33   
 
 34   
 
 35   
     /**
 36   
      * Updates the reservation and database according to the current usage - processed
 37   
      * BEFORE the transaction execution.
 38   
      * Returns false if the current usage is not compatoble with the associated
 39   
      * reservation.
 40   
      */
 41  0
     public boolean preSrvTrxExeUpdate( ReservationBase rsrv0, nmp.dbms.JDBC.Jdbc_Sql database) throws Exception {
 42  0
         if( ! ( rsrv0 instanceof ValueChangeReservation)) 
 43  0
             throw new mobisnap.MobisnapException( "Value-change reservation expected in preSrvTrxExeUpdate");
 44  0
         ValueChangeReservation rsrv = (ValueChangeReservation)rsrv0;
 45   
 
 46  0
         StringBuffer buffer = new StringBuffer();
 47  0
         buffer.append( "alter trigger mobi_vc_");
 48  0
         buffer.append( rsrv.column);
 49  0
         buffer.append( "_");
 50  0
         buffer.append( rsrv.table);
 51  0
         buffer.append( "_");
 52  0
         buffer.append( rsrv.getTriggerCode());
 53  0
         buffer.append(" disable;");
 54  0
         if( database.executeUpdate( buffer.toString()) != 1)
 55  0
             return false;
 56  0
         return true;
 57   
     }
 58   
 
 59   
     /**
 60   
      * Updates the reservation and database according to the current usage - processed
 61   
      * AFTER the transaction execution.
 62   
      * Returns true if the transaction has been completely used.
 63   
      */
 64  0
     public boolean postSrvTrxExeUpdate( ReservationBase rsrv0, nmp.dbms.JDBC.Jdbc_Sql database) throws Exception {
 65  0
         if( ! ( rsrv0 instanceof ValueChangeReservation)) 
 66  0
             throw new mobisnap.MobisnapException( "Escrow reservation expected in preSrvTrxExeUpdate");
 67  0
         ValueChangeReservation rsrv = (ValueChangeReservation)rsrv0;
 68   
         
 69  0
         StringBuffer buffer = new StringBuffer();
 70  0
         buffer.append( "alter trigger mobi_vc_");
 71  0
         buffer.append( rsrv.table);
 72  0
         buffer.append( "_");
 73  0
         buffer.append( rsrv.getTriggerCode());
 74  0
         buffer.append(" enable;");
 75  0
         database.executeUpdate( buffer.toString());
 76  0
         return false;
 77   
     }
 78   
 
 79   
     
 80   
 }