org.intermine.sql.query
Class AbstractTable

java.lang.Object
  extended by org.intermine.sql.query.AbstractTable
All Implemented Interfaces:
SQLStringable
Direct Known Subclasses:
SubQuery, Table

public abstract class AbstractTable
extends java.lang.Object
implements SQLStringable

An abstract representation of an item that can be present in the FROM section of an SQL query.


Field Summary
protected  java.lang.String alias
           
 
Constructor Summary
AbstractTable()
           
 
Method Summary
abstract  boolean equals(java.lang.Object obj)
          Overrides Object.equals().
abstract  boolean equalsIgnoreAlias(AbstractTable obj)
          Compare this AbstractTable to another, ignoring little details like aliases.
 boolean equalsOnlyAlias(AbstractTable obj)
          Compare this AbstractTable to another, only comparing the alias.
 java.lang.String getAlias()
          Returns the alias for this AbstractTable object.
abstract  java.lang.String getSQLString()
          Returns a String representation of this AbstractTable object, suitable for forming part of an SQL query.
abstract  int hashCode()
          Overrides Object.hashcode().
 void setAlias(java.lang.String alias)
          Sets the alias for this AbstractTable object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alias

protected java.lang.String alias
Constructor Detail

AbstractTable

public AbstractTable()
Method Detail

getAlias

public java.lang.String getAlias()
Returns the alias for this AbstractTable object.

Returns:
the alias of this "table"

setAlias

public void setAlias(java.lang.String alias)
Sets the alias for this AbstractTable object.

Parameters:
alias - the alias of this "table"

getSQLString

public abstract java.lang.String getSQLString()
Returns a String representation of this AbstractTable object, suitable for forming part of an SQL query.

Specified by:
getSQLString in interface SQLStringable
Returns:
the String representation

equals

public abstract boolean equals(java.lang.Object obj)
Overrides Object.equals().

Overrides:
equals in class java.lang.Object
Parameters:
obj - an Object to compare to
Returns:
true if obj is equal

hashCode

public abstract int hashCode()
Overrides Object.hashcode().

Overrides:
hashCode in class java.lang.Object
Returns:
an arbitrary integer based on the contents of the object

equalsIgnoreAlias

public abstract boolean equalsIgnoreAlias(AbstractTable obj)
Compare this AbstractTable to another, ignoring little details like aliases.

Parameters:
obj - an AbstractTable to compare to
Returns:
true if obj is equal

equalsOnlyAlias

public boolean equalsOnlyAlias(AbstractTable obj)
Compare this AbstractTable to another, only comparing the alias.

Parameters:
obj - an AbstractTable to compare to
Returns:
true if obj has the same alias