Package org.intermine.sql.query
Class Table
- java.lang.Object
-
- org.intermine.sql.query.AbstractTable
-
- org.intermine.sql.query.Table
-
- All Implemented Interfaces:
SQLStringable
public class Table extends AbstractTable
A representation of a table that can be present in the FROM section of an SQL query.- Author:
- Matthew Wakeling, Andrew Varley
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
-
Fields inherited from class org.intermine.sql.query.AbstractTable
alias
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Overrides Object.equals().boolean
equalsIgnoreAlias(AbstractTable obj)
Compare this Table to another AbstractTable, ignoring alias.java.lang.String
getName()
Returns the name of the tablejava.lang.String
getSQLString()
Returns a String representation of this Table object, suitable for forming part of an SQL query.int
hashCode()
Overrides Object.hashcode().java.lang.String
toString()
A toString method, which helps us when debugging.-
Methods inherited from class org.intermine.sql.query.AbstractTable
equalsOnlyAlias, getAlias, setAlias
-
-
-
-
Constructor Detail
-
Table
public Table(java.lang.String name, java.lang.String alias)
Constructor for this Table object.- Parameters:
name
- the name of the table, as the database knows italias
- an arbitrary name that the table has been renamed to for the rest of the query
-
Table
public Table(java.lang.String name)
Constructor for this Table object, without an alias.- Parameters:
name
- the name of the table, as the database knows it. This name is also used in the rest of the query.
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the table- Returns:
- the Table name
-
getSQLString
public java.lang.String getSQLString()
Returns a String representation of this Table object, suitable for forming part of an SQL query.- Specified by:
getSQLString
in interfaceSQLStringable
- Specified by:
getSQLString
in classAbstractTable
- Returns:
- the String representation
-
equals
public boolean equals(java.lang.Object obj)
Overrides Object.equals().- Specified by:
equals
in classAbstractTable
- Parameters:
obj
- an Object to compare to- Returns:
- true if the object is of the same class, and with the same name
-
hashCode
public int hashCode()
Overrides Object.hashcode().- Specified by:
hashCode
in classAbstractTable
- Returns:
- an arbitrary integer based on the name of the Table
-
equalsIgnoreAlias
public boolean equalsIgnoreAlias(AbstractTable obj)
Compare this Table to another AbstractTable, ignoring alias.- Specified by:
equalsIgnoreAlias
in classAbstractTable
- Parameters:
obj
- an AbstractTable to compare to- Returns:
- true if the object is of the same class, and with the same value
-
toString
public java.lang.String toString()
A toString method, which helps us when debugging.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a String representation of the object
-
-