org.vizzini.database
Class Association

java.lang.Object
  extended by org.vizzini.database.Association
All Implemented Interfaces:
IAssociation

 class Association
extends Object
implements IAssociation

Provides an instance of a join which allows fetching, associating, and disassociating Records.

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

Constructor Summary
Association(IDatabase database, JoinData joinData, boolean forward)
          Construct this object.
 
Method Summary
 void associate(IRecord record0, IRecord record1)
          Associate the given Records through my join.
 String constructSelectExpression(IRecord record)
          Construct a select expression based upon my join.
 void disassociate(IRecord record0, IRecord record1)
          Disassociate the given Records through my join.
 Iterator getItems()
          Return an iterator over items involved in my join.
 JoinData getJoinData()
          Return the join data.
 String getTableName()
          Return the "other" table name based upon my forward flag.
 boolean isForward()
          Return the forward flag.
 boolean isJunction()
          Return true if my join data represents a junction.
 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

Association

public Association(IDatabase database,
                   JoinData joinData,
                   boolean forward)
Construct this object.

Parameters:
database - The database.
joinData - The join data.
forward - Flag indicating if this is forward along the join.
Since:
v0.3
Method Detail

associate

public void associate(IRecord record0,
                      IRecord record1)
               throws SQLException
Associate the given Records through my join.

Specified by:
associate in interface IAssociation
Throws:
SQLException
Since:
v0.3

constructSelectExpression

public String constructSelectExpression(IRecord record)
Construct a select expression based upon my join.

Specified by:
constructSelectExpression in interface IAssociation
Since:
v0.3

disassociate

public void disassociate(IRecord record0,
                         IRecord record1)
                  throws SQLException
Disassociate the given Records through my join.

Specified by:
disassociate in interface IAssociation
Throws:
SQLException
Since:
v0.3

getItems

public Iterator getItems()
                  throws SQLException
Return an iterator over items involved in my join. Which table the items come from depends upon the forward flag.

Specified by:
getItems in interface IAssociation
Throws:
SQLException
Since:
v0.3

getJoinData

public JoinData getJoinData()
Return the join data.

Specified by:
getJoinData in interface IAssociation
Since:
v0.3

getTableName

public String getTableName()
Return the "other" table name based upon my forward flag.

Specified by:
getTableName in interface IAssociation
Since:
v0.3

isForward

public boolean isForward()
Return the forward flag.

Specified by:
isForward in interface IAssociation
Since:
v0.3

isJunction

public boolean isJunction()
Return true if my join data represents a junction.

Specified by:
isJunction in interface IAssociation
Since:
v0.3

toDebugString

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

Specified by:
toDebugString in interface IAssociation
Since:
v0.3

toString

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

Specified by:
toString in interface IAssociation
Overrides:
toString in class Object
Since:
v0.3


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