jimm.datavision.source
Class Join

java.lang.Object
  extended by jimm.datavision.source.Join
All Implemented Interfaces:
java.lang.Cloneable, Writeable

public class Join
extends java.lang.Object
implements Writeable, java.lang.Cloneable

A join represents the relationship between two columns in the database. It is used by a query to build the SQL string necessary to retrieve data.

Author:
Jim Menard, jimm@io.com
See Also:
Query

Field Summary
protected  Column from
           
protected  java.lang.String relation
           
static java.lang.String[] RELATIONS
           
protected  Column to
           
 
Constructor Summary
Join(Column fromCol, java.lang.String relation, Column toCol)
          Constructor.
 
Method Summary
 java.lang.Object clone()
           
 Column getFrom()
          Returns the "from" column.
 java.lang.String getRelation()
          Returns the relation string (for example, "=" or "<").
 Column getTo()
          Returns the "to" column.
 void setFrom(Column newFrom)
          Sets the "from" column.
 void setRelation(java.lang.String newRelation)
          Sets the relation string (for example, "=" or "<").
 void setTo(Column newTo)
          Sets the "to" column.
 java.lang.String toString()
          Returns a string representation of this join, usable as a where clause in a SQL query.
 void writeXML(XMLWriter out)
          Writes this join as an XML tag.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RELATIONS

public static final java.lang.String[] RELATIONS

from

protected Column from

relation

protected java.lang.String relation

to

protected Column to
Constructor Detail

Join

public Join(Column fromCol,
            java.lang.String relation,
            Column toCol)
Constructor.

Parameters:
fromCol - a database column
relation - a string like "=" or "<" used to join the two database columns
toCol - another database column
See Also:
Column
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getFrom

public Column getFrom()
Returns the "from" column.

Returns:
a column

setFrom

public void setFrom(Column newFrom)
Sets the "from" column.

Parameters:
newFrom - the new column

getRelation

public java.lang.String getRelation()
Returns the relation string (for example, "=" or "<").

Returns:
a string used to define the relationship between the two database columns

setRelation

public void setRelation(java.lang.String newRelation)
Sets the relation string (for example, "=" or "<").

Parameters:
newRelation - the new string

getTo

public Column getTo()
Returns the "to" column.

Returns:
a column

setTo

public void setTo(Column newTo)
Sets the "to" column.

Parameters:
newTo - the new column

toString

public java.lang.String toString()
Returns a string representation of this join, usable as a where clause in a SQL query.

Overrides:
toString in class java.lang.Object

writeXML

public void writeXML(XMLWriter out)
Writes this join as an XML tag.

Specified by:
writeXML in interface Writeable
Parameters:
out - a writer that knows how to write XML