1 package com.daffodilwoods.daffodildb.server.sql99.dml; 2 3 import java.util.*; 4 5 import com.daffodilwoods.daffodildb.server.serversystem.*; 6 import com.daffodilwoods.daffodildb.server.sql99.common.*; 7 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 8 import com.daffodilwoods.database.resource.*; 9 10 public class contextuallytypedrowvalueexpressionlist implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter, TypeConstants { 11 public contextuallytypedrowvalueexpression[] _OptRepScomma94843605contextuallytypedrowvalueexpression0; 12 13 int cardinality = 0; 14 15 22 23 public Object run(Object obj) throws com.daffodilwoods.database.resource.DException { 24 int length = _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; 25 Object [] arr = new Object [length]; 26 for (int i = 0; i < length; i++) { 27 arr[i] = _OptRepScomma94843605contextuallytypedrowvalueexpression0[i].run(obj); 28 } 29 return arr; 30 } 31 32 39 40 public int getCardinality() throws DException { 41 int len = _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; 42 int cardinalityFirst = _OptRepScomma94843605contextuallytypedrowvalueexpression0[0].getCardinality(); 43 if (cardinalityFirst == -1) { 44 return cardinality = cardinalityFirst; 45 } 46 int tempCardinality; 47 for (int i = 0; i < len; i++) { 48 tempCardinality = _OptRepScomma94843605contextuallytypedrowvalueexpression0[i].getCardinality(); 49 if (tempCardinality == -1) { 50 continue; 51 } 52 if (cardinalityFirst != tempCardinality) { 53 throw new DException("DSE214", (Object [])null); 54 } 55 } 56 return cardinality = cardinalityFirst; 57 } 58 59 65 66 public Object [] getParameters(Object object) throws DException { 67 int len = _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; 68 ArrayList arr = new ArrayList(len); 69 for (int i = 0; i < len; i++) { 70 Object [] parameter = _OptRepScomma94843605contextuallytypedrowvalueexpression0[i].getParameters(object); 71 if (parameter != null) { 72 arr.addAll(Arrays.asList(parameter)); 73 } 74 } 75 return arr.size() > 0 ? arr.toArray() : null; 76 } 77 78 83 84 public ParameterInfo[] getParameterInfo() throws DException { 85 int len = _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; 86 ArrayList arr = new ArrayList(len); 87 ParameterInfo[] pInfo; 88 for (int i = 0; i < len; i++) { 89 pInfo = _OptRepScomma94843605contextuallytypedrowvalueexpression0[i].getParameterInfo(); 90 if (pInfo != null) { 91 for (int j = 0; j < pInfo.length; j++) { 92 if(pInfo[j].getOridinalPosition()==-1) { 93 pInfo[j].setOrdinalPosition(i); 94 } 95 } 96 arr.addAll(Arrays.asList(pInfo)); 97 } 98 } 99 return arr.size() > 0 ? (ParameterInfo[]) arr.toArray(new ParameterInfo[0]) : null; 100 } 101 102 103 104 109 110 public ColumnDetails[] getColumnDetails() throws DException { 111 int len = _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; 112 ArrayList arr = new ArrayList(len); 113 ColumnDetails[] cd; 114 for (int i = 0; i < len; i++) { 115 cd = _OptRepScomma94843605contextuallytypedrowvalueexpression0[i].getColumnDetails(); 116 if (cd != null) { 117 arr.addAll(Arrays.asList(cd)); 118 } 119 } 120 return arr.size() > 0 ? (ColumnDetails[]) arr.toArray(new ColumnDetails[0]) : null; 121 } 122 123 public _Reference[] getReferences(TableDetails[] td) throws DException { 124 int len = _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; 125 ArrayList arr = new ArrayList(len); 126 _Reference[] ref; 127 for (int i = 0; i < len; i++) { 128 ref = _OptRepScomma94843605contextuallytypedrowvalueexpression0[i].getReferences(td); 129 if (ref != null) { 130 arr.addAll(Arrays.asList(ref)); 131 } 132 } 133 return arr.size() > 0 ? (_Reference[]) arr.toArray(new _Reference[0]) : null; 134 } 135 136 public _Reference[] checkSemantic(_ServerSession serverSession) throws DException { 137 int len = _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; 138 ArrayList arr = new ArrayList(len); 139 _Reference[] ref; 140 for (int i = 0; i < len; i++) { 141 ref = _OptRepScomma94843605contextuallytypedrowvalueexpression0[i].checkSemantic(serverSession); 142 if (ref != null) { 143 arr.addAll(Arrays.asList(ref)); 144 } 145 } 146 return arr.size() > 0 ? (_Reference[]) arr.toArray(new _Reference[0]) : null; 147 } 148 149 public Object clone() throws CloneNotSupportedException { 150 return this; 151 } 152 153 public String toString() { 154 StringBuffer sb = new StringBuffer (); 155 sb.append(" "); 156 sb.append(_OptRepScomma94843605contextuallytypedrowvalueexpression0[0]); 157 for (int i = 1; i < _OptRepScomma94843605contextuallytypedrowvalueexpression0.length; i++) { 158 sb.append(",").append(_OptRepScomma94843605contextuallytypedrowvalueexpression0[i]); 159 } 160 return sb.toString(); 161 } 162 public void getTablesIncluded(ArrayList arrayList) throws DException{ 163 for(int i=0;i< _OptRepScomma94843605contextuallytypedrowvalueexpression0.length ;i++){ 164 _OptRepScomma94843605contextuallytypedrowvalueexpression0[i]. 165 getTablesIncluded(arrayList); 166 } 167 } 168 169 } 170 | Popular Tags |