1 23 24 27 package org.objectweb.medor.query.lib; 28 29 import org.objectweb.medor.api.MedorException; 30 import org.objectweb.medor.expression.api.Expression; 31 import org.objectweb.medor.query.api.OperationType; 32 import org.objectweb.medor.query.api.QueryTree; 33 import org.objectweb.medor.query.api.QueryTreeField; 34 35 public class Union extends BasicQueryNode { 36 37 public Union() { 38 } 39 40 public Union(QueryTree leftQT, 41 QueryTree rightQT, 42 String nodeName) 43 throws MedorException { 44 super(nodeName); 45 46 if (leftQT.getTupleStructure().getSize() 48 != rightQT.getTupleStructure().getSize()) { 49 throw new MedorException( 50 "Impossible to perform Union Operation"); 51 } 52 for (int i = 1; i < leftQT.getTupleStructure().getSize(); i++) { 53 if (!leftQT.getTupleStructure().getField(i).getName() 54 .equalsIgnoreCase( 55 rightQT.getTupleStructure().getField(i).getName())) { 56 throw new MedorException( 57 "Impossible to perform Union Operation"); 58 } 59 } 60 for (int i = 1; i < leftQT.getTupleStructure().getSize(); i++) { 62 QueryTreeField[] anc = new QueryTreeField[2]; 63 } 65 } 66 67 public short getType() { 68 return OperationType.UNION; 69 } 70 71 public void setQueryFilter(Expression e) { 72 throw new UnsupportedOperationException ("Unions cannot be assigned a filter."); 73 } 74 75 } 76 | Popular Tags |