org.d2rq.db.expr
Class Constant

java.lang.Object
  extended by org.d2rq.db.expr.Expression
      extended by org.d2rq.db.expr.Constant

public class Constant
extends Expression

A constant-valued expression. The datatype of the constant must be specified. For situations where the datatype is not yet known at constant creation time, a column name, expression, or generic type can be specified instead.

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
 
Fields inherited from class org.d2rq.db.expr.Expression
FALSE, TRUE
 
Method Summary
static Constant create(String value, ColumnName columnForType)
           
static Constant create(String value, DataType.GenericType genericType)
           
static Constant create(String value, DataType dataType)
           
static Constant create(String value, Expression expressionForType)
           
 boolean equals(Object other)
           
 Set<ColumnName> getColumns()
           
 DataType getDataType(DatabaseOp table, Vendor vendor)
           
 int hashCode()
           
 boolean isFalse()
           
 boolean isTrue()
           
 Expression rename(Renamer columnRenamer)
           
 String toSQL(DatabaseOp table, Vendor vendor)
           
 String toString()
           
 String value()
           
 
Methods inherited from class org.d2rq.db.expr.Expression
and, or
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static Constant create(String value,
                              DataType.GenericType genericType)

create

public static Constant create(String value,
                              DataType dataType)

create

public static Constant create(String value,
                              ColumnName columnForType)

create

public static Constant create(String value,
                              Expression expressionForType)

value

public String value()

getColumns

public Set<ColumnName> getColumns()
Specified by:
getColumns in class Expression

isFalse

public boolean isFalse()
Specified by:
isFalse in class Expression

isTrue

public boolean isTrue()
Specified by:
isTrue in class Expression

rename

public Expression rename(Renamer columnRenamer)
Specified by:
rename in class Expression

toSQL

public String toSQL(DatabaseOp table,
                    Vendor vendor)
Specified by:
toSQL in class Expression

getDataType

public DataType getDataType(DatabaseOp table,
                            Vendor vendor)
Specified by:
getDataType in class Expression

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object