1 package com.daffodilwoods.daffodildb.server.sql99.ddl.utility; 2 3 import com.daffodilwoods.daffodildb.server.serversystem.*; 4 import com.daffodilwoods.daffodildb.server.sql99.dql.iterator.*; 5 import com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents.*; 6 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 7 import com.daffodilwoods.daffodildb.utils.field.*; 8 import com.daffodilwoods.database.resource.*; 9 10 public class CheckConstraintVariableValues implements _VariableValues { 11 12 _Iterator iter = null; 13 _ServerSession serverSession; 14 Object [][] mappings; 15 FieldBase colFieldBase; 16 public CheckConstraintVariableValues( _Iterator iter0, _ServerSession serverSession0 , Object [][] mappings0,FieldBase colFieldBase0) { 17 iter = iter0; 18 serverSession = serverSession0; 19 mappings = mappings0; 20 colFieldBase = colFieldBase0; 21 } 22 23 public Object getColumnValues(_Reference[] ref) throws DException { 24 Object [] val = null; 25 if( ref != null ){ 26 int len = ref.length; 27 val = new Object [len]; 28 for( int i=0; i<len; i++ ) { 29 val[i] = getColumnValues(ref[i]); 30 } 31 } 32 return val; 33 } 34 35 public Object getColumnValues(_Reference ref) throws DException { 36 if(mappings != null) { 37 for (int j = 0; j < mappings.length; j++) 38 if( mappings[j][0] == ref ) 39 return ((_SelectIterator) mappings[j][1]); 40 } 41 try { 42 return iter.getColumnValues(ref); 43 } 44 catch (DException ex) { 45 return colFieldBase; 46 } 47 } 48 49 public void setIterator(_Iterator p0) throws DException { 50 } 51 52 public void setConditionVariableValue(_Reference[] p0, Object [] p1, int p2) throws DException { 53 if(mappings == null) 54 return; 55 for (int j = 0; j < mappings.length; j++) 56 ((_Iterator) mappings[j][1]).setConditionVariableValue(p0,p1,p2); 57 } 58 59 public Object [][] getReferenceAndValuePair() throws DException { 60 return null; 61 } 62 public void addReferences(_Reference[] parm1) throws com.daffodilwoods.database.resource.DException { 63 throw new java.lang.UnsupportedOperationException ("Method addReferences() not yet implemented."); 64 } 65 66 public void releaseResource() throws DException { 67 } 68 69 public FieldBase field(_Reference parm1) throws com.daffodilwoods.database.resource.DException { 70 return (FieldBase)getColumnValues(parm1); 71 } 72 73 public _ServerSession getServerSession() throws DException { 74 return serverSession; 75 } 76 77 78 } 79 | Popular Tags |