org.apache.torque.util
Class Query.FromElement

java.lang.Object
  extended by org.apache.torque.util.Query.FromElement
Enclosing class:
Query

public static class Query.FromElement
extends java.lang.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.


Constructor Summary
Query.FromElement(java.lang.String tableName, SqlEnum joinType, java.lang.String joinCondition)
          Constructor
 
Method Summary
 java.lang.String getJoinCondition()
           
 SqlEnum getJoinType()
           
 java.lang.String getTableName()
           
 java.lang.String toString()
          Returns a SQL representation of the element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query.FromElement

public Query.FromElement(java.lang.String tableName,
                         SqlEnum joinType,
                         java.lang.String joinCondition)
Constructor

Parameters:
tableName - the tablename, might contain an appended alias name e.g.
table_1
table_1 alias_for_table_1
joinType - the type of the join, e.g. SqlEnum.LEFT_JOIN, or null if no excplicit join is wanted
joinCondition - 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)
Method Detail

getJoinCondition

public java.lang.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 java.lang.String getTableName()
Returns:
the tablename, might contain an appended alias name, e.g.
table_1
table_1 alias_for_table_1

toString

public java.lang.String toString()
Returns a SQL representation of the element

Overrides:
toString in class java.lang.Object
Returns:
a SQL representation of the element


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.