1 23 package org.objectweb.medor.query.lib; 24 25 import org.objectweb.medor.api.Field; 26 import org.objectweb.medor.api.MedorException; 27 import org.objectweb.medor.expression.api.Expression; 28 import org.objectweb.medor.query.api.OperationType; 29 import org.objectweb.medor.query.api.QueryTree; 30 import org.objectweb.medor.query.api.QueryTreeField; 31 32 public class Project extends BasicQueryNode { 33 34 public Project() { 35 } 36 37 40 public Project(String name) { 41 super(name); 42 } 43 44 51 public Project(String [] fieldNames, QueryTree child, String nodeName) 52 throws MedorException { 53 super(nodeName); 54 for (int i = 0; i < fieldNames.length; i++) { 55 Field f = child.getTupleStructure().getField(fieldNames[i]); 56 QueryTreeField[] anc = new QueryTreeField[1]; 57 anc[0] = (QueryTreeField) f; 58 addPropagatedField(f.getName(), f.getType(), anc); 59 } 60 } 61 62 public short getType() { 63 return OperationType.PROJECT; 64 } 65 66 public void setQueryFilter(Expression e) { 67 throw new UnsupportedOperationException ("Projections cannot be assigned a filter."); 68 } 69 } 70 | Popular Tags |