Package org.intermine.sql.query
Class SubQuery
- java.lang.Object
-
- org.intermine.sql.query.AbstractTable
-
- org.intermine.sql.query.SubQuery
-
- All Implemented Interfaces:
SQLStringable
public class SubQuery extends AbstractTable
A representation of a subquery that can be present in the FROM section of an SQL query.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description protected Query
query
-
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 SubQuery to another AbstractTable, ignoring alias.Query
getQuery()
Returns the query contained in the subquery.java.lang.String
getSQLString()
Returns a String representation of this SubQuery object, auitable for forming part of an SQL query.int
hashCode()
Overrides Object.hashCode().-
Methods inherited from class org.intermine.sql.query.AbstractTable
equalsOnlyAlias, getAlias, setAlias
-
-
-
-
Field Detail
-
query
protected Query query
-
-
Constructor Detail
-
SubQuery
public SubQuery(Query query, java.lang.String alias)
Constructor for this SubQuery object.- Parameters:
query
- a Query to be included as a subqueryalias
- an arbitrary name that the subquery has been renamed to for the rest of the query
-
-
Method Detail
-
getQuery
public Query getQuery()
Returns the query contained in the subquery.- Returns:
- the subquery
-
getSQLString
public java.lang.String getSQLString()
Returns a String representation of this SubQuery object, auitable 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 an equal query and alias
-
hashCode
public int hashCode()
Overrides Object.hashCode().- Specified by:
hashCode
in classAbstractTable
- Returns:
- an arbitrary integer created from the contents of the SubQuery
-
equalsIgnoreAlias
public boolean equalsIgnoreAlias(AbstractTable obj)
Compare this SubQuery 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 an equal query
-
-