org.apache.torque.util
Class Query.FromElement
java.lang.Object
org.apache.torque.util.Query.FromElement
- Enclosing class:
- Query
public static class Query.FromElement
- extends Object
This class describes an Element in the From-part of a SQL clause.
It must contain the name of the database table.
It might contain an alias for the table name, a join type
and a join condition.
The class is package visible, as it is used in BasePeer,
and is immutable.
Query.FromElement
public Query.FromElement(String tableName,
SqlEnum joinType,
String joinCondition)
- Constructor
- Parameters:
tableName
- the tablename, might contain an appended alias name
e.g.
table_1
table_1 alias_for_table_1joinType
- the type of the join, e.g. SqlEnum.LEFT_JOIN,
or null if no excplicit join is wantedjoinCondition
- the join condition,
e.g. table_a.id = table_b.a_id,
or null if no explicit join is wanted
(In this case, the join condition is appended to the
whereClause instead)
getJoinCondition
public String getJoinCondition()
- Returns:
- the join condition, e.g. table_a.id = table_b.a_id,
or null if the join is not an explicit join
getJoinType
public SqlEnum getJoinType()
- Returns:
- the type of the join, e.g. SqlEnum.LEFT_JOIN,
or null if the join is not an explicit join
getTableName
public String getTableName()
- Returns:
- the tablename, might contain an appended alias name,
e.g.
table_1
table_1 alias_for_table_1
toString
public String toString()
- Returns a SQL representation of the element
- Overrides:
toString
in class Object
- Returns:
- a SQL representation of the element
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.