org.vizzini.database
Class JoinData

java.lang.Object
  extended by org.vizzini.database.JoinData
Direct Known Subclasses:
JunctionData

 class JoinData
extends Object

Provides storage for data detailing a join between two tables. The first table and first column are assumed to be the foreign key field.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Constructor Summary
JoinData()
           
 
Method Summary
 void associate(IRecord record0, IRecord record1)
          Associate the given records.
 String constructSelectExpression(ITableData targetTableData, IRecord record, boolean forward)
          Construct a select expression using this join.
 void disassociate(IRecord record0, IRecord record1)
          Disassociate the given records.
 String getColumnName1()
          Return the first column name.
 String getColumnName2()
          Return the second column name.
 String getLastTableName()
          Return the last table name.
 String getTableName1()
          Return the first table name.
 String getTableName2()
          Return the second table name.
 void inflate(Element element)
          Inflate this object from the given XML element.
 boolean match(String startTableName, String endTableName)
          Return true if the given table names match this join.
 void setColumnName1(String name)
          Set the first column name.
 void setColumnName2(String name)
          Set the second column name.
 void setTableName1(String name)
          Set the first table name.
 void setTableName2(String name)
          Set the second table name.
 String toDebugString()
          Return a debug string representation of this object.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JoinData

JoinData()
Method Detail

associate

public void associate(IRecord record0,
                      IRecord record1)
               throws SQLException
Associate the given records. This method assumes the first record has the foreign key field.

Throws:
SQLException
Since:
v0.3

constructSelectExpression

public String constructSelectExpression(ITableData targetTableData,
                                        IRecord record,
                                        boolean forward)
Construct a select expression using this join.

Since:
v0.3

disassociate

public void disassociate(IRecord record0,
                         IRecord record1)
                  throws SQLException
Disassociate the given records. This method assumes the first record has the foreign key field.

Throws:
SQLException
Since:
v0.3

getColumnName1

public String getColumnName1()
Return the first column name.

Since:
v0.3

getColumnName2

public String getColumnName2()
Return the second column name.

Since:
v0.3

getLastTableName

public String getLastTableName()
Return the last table name. For this class, this is the second table name.

Since:
v0.3

getTableName1

public String getTableName1()
Return the first table name.

Since:
v0.3

getTableName2

public String getTableName2()
Return the second table name.

Since:
v0.3

inflate

public void inflate(Element element)
Inflate this object from the given XML element.

Since:
v0.3

match

public boolean match(String startTableName,
                     String endTableName)
Return true if the given table names match this join.

Since:
v0.3

setColumnName1

public void setColumnName1(String name)
Set the first column name.

Since:
v0.3

setColumnName2

public void setColumnName2(String name)
Set the second column name.

Since:
v0.3

setTableName1

public void setTableName1(String name)
Set the first table name.

Since:
v0.3

setTableName2

public void setTableName2(String name)
Set the second table name.

Since:
v0.3

toDebugString

public String toDebugString()
Return a debug string representation of this object.

Since:
v0.3

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02