com.samskivert.jdbc.depot.clause
Class Join

java.lang.Object
  extended by com.samskivert.jdbc.depot.clause.QueryClause
      extended by com.samskivert.jdbc.depot.clause.Join
All Implemented Interfaces:
SQLExpression

public class Join
extends QueryClause

Represents a JOIN.


Nested Class Summary
static class Join.Type
          Indicates the join type to be used.
 
Field Summary
protected  Class<? extends PersistentRecord> _joinClass
          The class of the table we're to join against.
protected  SQLExpression _joinCondition
          The condition used to join in the new table.
protected  Join.Type _type
          Indicates the type of join to be performed.
 
Constructor Summary
Join(Class<? extends PersistentRecord> joinClass, SQLExpression joinCondition)
           
Join(Class<? extends PersistentRecord> pClass, String pCol, Class<? extends PersistentRecord> joinClass, String jCol)
           
Join(ColumnExp primary, ColumnExp join)
           
 
Method Summary
 void accept(ExpressionVisitor builder)
          Most uses of this class have been implemented with a visitor pattern.
 void addClasses(Collection<Class<? extends PersistentRecord>> classSet)
          Adds all persistent classes that are brought into the SQL context by this clause: FROM clauses, JOINs, UPDATEs, anything that could create a new table abbreviation.
 Class<? extends PersistentRecord> getJoinClass()
           
 SQLExpression getJoinCondition()
           
 Join.Type getType()
           
 Join setType(Join.Type type)
          Configures the type of join to be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_type

protected Join.Type _type
Indicates the type of join to be performed.


_joinClass

protected Class<? extends PersistentRecord> _joinClass
The class of the table we're to join against.


_joinCondition

protected SQLExpression _joinCondition
The condition used to join in the new table.

Constructor Detail

Join

public Join(Class<? extends PersistentRecord> pClass,
            String pCol,
            Class<? extends PersistentRecord> joinClass,
            String jCol)

Join

public Join(ColumnExp primary,
            ColumnExp join)

Join

public Join(Class<? extends PersistentRecord> joinClass,
            SQLExpression joinCondition)
Method Detail

setType

public Join setType(Join.Type type)
Configures the type of join to be performed.


getType

public Join.Type getType()

getJoinClass

public Class<? extends PersistentRecord> getJoinClass()

getJoinCondition

public SQLExpression getJoinCondition()

accept

public void accept(ExpressionVisitor builder)
            throws Exception
Description copied from interface: SQLExpression
Most uses of this class have been implemented with a visitor pattern. Create your own ExpressionVisitor and call this method with it.

Throws:
Exception
See Also:
SQLBuilder

addClasses

public void addClasses(Collection<Class<? extends PersistentRecord>> classSet)
Description copied from interface: SQLExpression
Adds all persistent classes that are brought into the SQL context by this clause: FROM clauses, JOINs, UPDATEs, anything that could create a new table abbreviation. This method should recurse into any subordinate state that may in turn bring in new classes so that sub-queries work correctly.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.