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

This page was automatically generated by Maven