1 package mobisnap.common.reservation; 2 3 import java.io.*; 4 import mobisnap.mobile_trx.*; 5 6 /*** 7 * Represents a escrow reservation 8 * 9 * @version 0.045 12-Dec-2000 10 * @author Nuno Pregui´┐Ża 11 */ 12 public class EscrowReservation 13 extends ReservationBase 14 implements Serializable 15 { 16 Object instances; 17 18 public EscrowReservation( String table, String column, Object instances) { 19 super( table, column); 20 this.instances = instances; 21 } 22 23 public Object getInstances(){ 24 return instances; 25 } 26 27 /*** 28 * Checks the given parameters are backed up by this reservation. 29 * If so, sets the reserved value to the variable and 30 * associate the reservation with the given variable - through a REservationUseBase 31 * class which is returned 32 * NOTE: Currently only select in the form of 33 * "select col(,col)* into var(,var)* from table where cond1 (AND cond2)*" 34 * can be checked 35 * 36 * @param var Variable involved 37 * @param table Table name of possible reservation 38 * @param column Column name of possible reservation 39 * @param where Table row specification 40 * @return Return null if there is no associateion between the given parameters 41 * ans this reservation. Otherwise returns a class to represent the reservation use 42 */ 43 public ReservationUseBase checkReservation( MSQLTVariable var, String table, String column, SimpleNode where) { 44 if( checkReservation( table, column, where)) { 45 ReservationUseBase rub = new EscrowReservationUse( this); 46 var.associateRsrv( rub); 47 try { 48 var.setValue( instances); 49 } catch( Exception e) { 50 // do nothing 51 } 52 return rub; 53 } 54 return null; 55 56 } 57 58 /*** 59 * Returns a readable representation of this reervation - format:<BR> 60 * escrow rsrv_id reservation column from table where row specification instances number 61 */ 62 public String toString() { 63 return "ESCROW " + super.toString() + " INSTANCES " + instances; 64 } 65 }

This page was automatically generated by Maven