org.d2rq.db.op
Class SQLOp

java.lang.Object
  extended by org.d2rq.db.op.SQLOp
All Implemented Interfaces:
DatabaseOp

public class SQLOp
extends Object
implements DatabaseOp

A SQL SELECT statement. The query is given as a string. The exported column names are unqualified.

Author:
Richard Cyganiak (richard@cyganiak.de)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.d2rq.db.op.DatabaseOp
DatabaseOp.Wrapper
 
Field Summary
 
Fields inherited from interface org.d2rq.db.op.DatabaseOp
TRUE
 
Constructor Summary
SQLOp(SQLConnection sqlConnection, String sql, List<ColumnDef> columns)
           
 
Method Summary
 void accept(OpVisitor visitor)
           
 boolean equals(Object other)
           
 List<ColumnName> getColumns()
           
 DataType getColumnType(ColumnName column)
           
 String getSQL()
           
 SQLConnection getSQLConnection()
           
 TableName getTableName()
           
 Collection<Key> getUniqueKeys()
           
 boolean hasColumn(ColumnName column)
           
 int hashCode()
           
 boolean isNullable(ColumnName column)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLOp

public SQLOp(SQLConnection sqlConnection,
             String sql,
             List<ColumnDef> columns)
Method Detail

getSQL

public String getSQL()

getTableName

public TableName getTableName()
Specified by:
getTableName in interface DatabaseOp
Returns:
Name in [[CATALOG.]SCHEMA.]TABLE notation, possibly null

hasColumn

public boolean hasColumn(ColumnName column)
Specified by:
hasColumn in interface DatabaseOp
Parameters:
column - A qualified or unqualified column name
Returns:
false for ambiguous unqualified names

getColumns

public List<ColumnName> getColumns()
Specified by:
getColumns in interface DatabaseOp
Returns:
Fully qualified column names if possible, no duplicates

isNullable

public boolean isNullable(ColumnName column)
Specified by:
isNullable in interface DatabaseOp

getColumnType

public DataType getColumnType(ColumnName column)
Specified by:
getColumnType in interface DatabaseOp

getUniqueKeys

public Collection<Key> getUniqueKeys()
Specified by:
getUniqueKeys in interface DatabaseOp

getSQLConnection

public SQLConnection getSQLConnection()

accept

public void accept(OpVisitor visitor)
Specified by:
accept in interface DatabaseOp

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