org.d2rq.db.op
Class ProjectionSpec
java.lang.Object
org.d2rq.db.op.ProjectionSpec
- All Implemented Interfaces:
- Comparable<ProjectionSpec>
- Direct Known Subclasses:
- ProjectionSpec.ColumnProjectionSpec, ProjectionSpec.ExprProjectionSpec
public abstract class ProjectionSpec
- extends Object
- implements Comparable<ProjectionSpec>
Something to be used in the SELECT clause of a SQL query, e.g.
a column name or an expression.
TODO: ProjectionSpec is kind of conceptually broken. ColumnName
should be used instead. Instead of creating ProjectionSpec.ExprProjectionSpec
instances, modify the DatabaseOp
by adding a ProjectOp
- Author:
- Richard Cyganiak (richard@cyganiak.de)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProjectionSpec
public ProjectionSpec()
getColumn
public abstract ColumnName getColumn()
getTableNames
public abstract Set<TableName> getTableNames()
rename
public abstract ProjectionSpec rename(Renamer renamer)
toSQL
public abstract String toSQL(DatabaseOp table,
Vendor vendor)
getDataType
public abstract DataType getDataType(DatabaseOp table)
getColumns
public abstract Set<ColumnName> getColumns()
create
public static ProjectionSpec create(ColumnName column)
createFromColumns
public static List<ProjectionSpec> createFromColumns(ColumnName[] columns)
createFromColumns
public static List<ProjectionSpec> createFromColumns(List<ColumnName> columns)
create
public static ProjectionSpec create(Expression expression,
Vendor vendor)
- Creates a projection spec from an expression.
- Parameters:
expression
- An expressionvendor
- For determining the expression's datatype
- Returns:
- A matching projection spec
create
public static ProjectionSpec create(ColumnName column,
Expression expression,
Vendor vendor)
createColumnNameFor
public static ColumnName createColumnNameFor(Expression expression)
- Returns a column name guaranteed to be unique to the given expression.
Subsequent invocations with the same expression return the same name.