public class Attribute extends Object implements ProjectionSpec
Constructor and Description |
---|
Attribute(RelationName relationName,
String attributeName) |
Attribute(String schemaName,
String tableName,
String attributeName)
Constructs a new attribute from a schema name, table name
and attribute name.
|
Modifier and Type | Method and Description |
---|---|
String |
attributeName()
Extracts the database column name from a tablename.columnname
combination.
|
int |
compareTo(ProjectionSpec other)
Compares columns alphanumerically by qualified name, case sensitive.
|
boolean |
equals(Object other)
Compares this instance to another object.
|
int |
hashCode()
Returns a hash code for this intance.
|
Expression |
notNullExpression(ConnectedDB db,
AliasMap aliases) |
String |
qualifiedName()
Returns the column name in Table.Column form
|
RelationName |
relationName()
Returns the table name, including the schema if the table is
in a schema.
|
ProjectionSpec |
renameAttributes(ColumnRenamer renamer) |
Set<Attribute> |
requiredAttributes() |
String |
schemaName()
Extracts the database schema name from a schema.table.colum combination.
|
Expression |
selectValue(String value) |
String |
tableName()
Returns the database table name.
|
Expression |
toExpression() |
String |
toSQL(ConnectedDB database,
AliasMap aliases) |
String |
toString() |
public Attribute(String schemaName, String tableName, String attributeName)
schemaName
- The schema name, or null if not in a schematableName
- The table nameattributeName
- The column namepublic Attribute(RelationName relationName, String attributeName)
public String qualifiedName()
public String toSQL(ConnectedDB database, AliasMap aliases)
toSQL
in interface ProjectionSpec
public String attributeName()
public String tableName()
public RelationName relationName()
public String schemaName()
public Set<Attribute> requiredAttributes()
requiredAttributes
in interface ProjectionSpec
public Expression selectValue(String value)
public ProjectionSpec renameAttributes(ColumnRenamer renamer)
renameAttributes
in interface ProjectionSpec
public Expression toExpression()
toExpression
in interface ProjectionSpec
public Expression notNullExpression(ConnectedDB db, AliasMap aliases)
notNullExpression
in interface ProjectionSpec
public boolean equals(Object other)
public int hashCode()
public int compareTo(ProjectionSpec other)
compareTo
in interface Comparable<ProjectionSpec>