Klasse FromElement

java.lang.Object
org.apache.torque.criteria.FromElement
Alle implementierten Schnittstellen:
Serializable

public class FromElement extends Object implements Serializable
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 a join condition and prepared statement replacements. The class is immutable.
Siehe auch:
  • Konstruktordetails

    • FromElement

      public FromElement(String tableName)
      Constructor with join type null and joinCondition null.
      Parameter:
      tableName - the table name, might contain an appended alias name, e.g.

      table_1

      table_1 alias_for_table_1

    • FromElement

      public FromElement(String fromExpression, JoinType joinType, String joinCondition)
      Constructor.
      Parameter:
      fromExpression - the expression to add to the from clause, e.g. a simple table name or a table name with an alias,

      table_1

      table_1 alias_for_table_1

      joinType - the type of the join, e.g. JoinType.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)
    • FromElement

      public FromElement(String fromExpression, JoinType joinType, String joinCondition, List<Object> preparedStatementReplacements)
      Constructor.
      Parameter:
      fromExpression - the expression to add to the from clause, e.g. a simple table name or a table name with an alias,

      table_1

      table_1 alias_for_table_1

      joinType - the type of the join, e.g. JoinType.LEFT_JOIN, or null if no explicit 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)
      preparedStatementReplacements - the replacements for placeholders which might occur in the fromExpression, may be null.
    • FromElement

      public FromElement(String fromExpression, JoinType joinType, PreparedStatementPart joinCondition)
      Constructor.
      Parameter:
      fromExpression - the expression to add to the from clause, e.g. a simple table name or a table name with an alias,

      table_1

      table_1 alias_for_table_1

      joinType - the type of the join, e.g. JoinType.LEFT_JOIN, or null if no explicit join is wanted
      joinCondition - the join condition, e.g. table_a.id = table_b.a_id, not null.
  • Methodendetails

    • getJoinCondition

      public String getJoinCondition()
      Returns the join condition.
      Gibt zurück:
      the join condition, e.g. table_a.id = table_b.a_id, or null if the join is not an explicit join
    • getJoinType

      public JoinType getJoinType()
      Returns the join type.
      Gibt zurück:
      the type of the join, e.g. JoinType.LEFT_JOIN, or null if the join is not an explicit join
    • getFromExpression

      public String getFromExpression()
      Returns the fromExpression, which might e.g. be a simple table name or a table name or a subquery with an alias appended.
      Gibt zurück:
      the tablename, might contain an appended alias name, e.g.

      table_1

      table_1 alias_for_table_1

    • getPreparedStatementReplacements

      public List<Object> getPreparedStatementReplacements()
      Returns the replacements for prepared statement placeholders in the fromExpression.
      Gibt zurück:
      the replacements, not null.
    • toString

      public String toString()
      Returns a SQL representation of the element.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      a SQL representation of the element
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object