1 17 package org.apache.ws.jaxme.sqls.impl; 18 19 import org.apache.ws.jaxme.sqls.Column; 20 import org.apache.ws.jaxme.sqls.ColumnReference; 21 import org.apache.ws.jaxme.sqls.Function; 22 import org.apache.ws.jaxme.sqls.SelectStatement; 23 import org.apache.ws.jaxme.sqls.Table; 24 import org.apache.ws.jaxme.sqls.TableReference; 25 26 27 37 public class VirtualColumn extends AbstractColumn implements ColumnReference { 38 private Column.Name alias; 39 private Object value; 40 41 public VirtualColumn(Column.Name pName, Column.Type pType) { 42 super(pName, pType); 43 } 44 45 public VirtualColumn(String pName, Column.Type pType) { 46 super(new ColumnImpl.NameImpl(pName), pType); 47 } 48 49 public Table getTable() { return null; } 50 public String getQName() { return getName().toString(); } 51 public boolean isPrimaryKeyPart() { return false; } 52 public TableReference getTableReference() { return null; } 53 public Column getColumn() { return this; } 54 public boolean isVirtual() { return true; } 55 56 public void setAlias(String pName) { 57 setAlias(new ColumnImpl.NameImpl(pName)); 58 } 59 60 public void setAlias(Name pName) { 61 alias = pName; 62 } 63 64 public Name getAlias() { 65 return alias; 66 } 67 68 public void setValue(String pValue) { 69 value = pValue; 70 } 71 72 public void setValue(SelectStatement pValue) { 73 value = pValue; 74 } 75 76 public void setValue(Function pValue) { 77 value = pValue; 78 } 79 80 public Object getValue() { 81 return value; 82 } 83 } 84 | Popular Tags |