org.xorm
Class RelationshipProxy

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--org.xorm.CollectionProxy
              |
              +--org.xorm.RelationshipProxy
All Implemented Interfaces:
Collection, I15d
Direct Known Subclasses:
ListProxy

public class RelationshipProxy
extends CollectionProxy

Represents a one-to-many or many-to-many relationship. An instance of RelationshipProxy is constructed in InterfaceInvocationHandler.invokeCollectionGet().


Nested Class Summary
protected  class RelationshipProxy.RelationshipProxyIterator
           
 
Nested classes inherited from class org.xorm.CollectionProxy
 
Field Summary
protected  Object[] args
           
protected  Collection deletedRows
           
protected static Logger logger
           
protected  RelationshipMapping mapping
           
protected  Collection newRows
           
protected  InterfaceInvocationHandler owner
           
protected  boolean txnManaged
           
 
Fields inherited from class org.xorm.CollectionProxy
classMapping, closed, iterator, mgr, rows, rowToProxy, selector, sizeHint
 
Fields inherited from interface org.xorm.I15d
I18N
 
Constructor Summary
RelationshipProxy(org.xorm.InterfaceManager mgr, RelationshipMapping mapping, InterfaceInvocationHandler owner, ClassMapping classMapping, Object[] args)
          Creates a new proxy backed by the data in the rows collection.
 
Method Summary
 boolean add(Object o)
          Adds the given object (proxy object) to the collection.
 void clear()
          Removes all rows.
 boolean dependsOn(InterfaceInvocationHandler other)
           
protected  void forceTransaction()
          Ensures that the proxy is registered in a transaction if necessary.
 Class getElementType()
          Overrides CollectionProxy implementation.
protected  Column getKeyColumn()
          Returns the column on the rows held by this object that contains the primary keys of the element type.
 InterfaceInvocationHandler getOwner()
          Returns the owner of this directional relationship.
 RelationshipMapping getRelationshipMapping()
          Returns the underlying relationship mapping this represents.
protected  Selector getSelector()
           
 Iterator iterator()
           
 void notifyIDChanged(Object oldID, Object newID)
          Called when an object ID changes.
 boolean remove(Object o)
          Removes the given object (proxy object) from the collection.
 
Methods inherited from class org.xorm.CollectionProxy
close, getInterfaceManager, getRows, size
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

logger

protected static Logger logger

txnManaged

protected boolean txnManaged

mapping

protected RelationshipMapping mapping

owner

protected InterfaceInvocationHandler owner

deletedRows

protected Collection deletedRows

newRows

protected Collection newRows

args

protected Object[] args
Constructor Detail

RelationshipProxy

public RelationshipProxy(org.xorm.InterfaceManager mgr,
                         RelationshipMapping mapping,
                         InterfaceInvocationHandler owner,
                         ClassMapping classMapping,
                         Object[] args)
Creates a new proxy backed by the data in the rows collection.

Method Detail

getRelationshipMapping

public RelationshipMapping getRelationshipMapping()
Returns the underlying relationship mapping this represents.


getOwner

public InterfaceInvocationHandler getOwner()
Returns the owner of this directional relationship.


getElementType

public Class getElementType()
Overrides CollectionProxy implementation.

Overrides:
getElementType in class CollectionProxy

getSelector

protected Selector getSelector()

forceTransaction

protected void forceTransaction()
Ensures that the proxy is registered in a transaction if necessary.


add

public boolean add(Object o)
Adds the given object (proxy object) to the collection.

Specified by:
add in interface Collection
Overrides:
add in class CollectionProxy

remove

public boolean remove(Object o)
Removes the given object (proxy object) from the collection.

Specified by:
remove in interface Collection
Overrides:
remove in class CollectionProxy

clear

public void clear()
Removes all rows. This is slightly more straightforward than iterating through and removing each element (but that works too).

Specified by:
clear in interface Collection
Overrides:
clear in class AbstractCollection

notifyIDChanged

public void notifyIDChanged(Object oldID,
                            Object newID)
Called when an object ID changes.


dependsOn

public boolean dependsOn(InterfaceInvocationHandler other)

getKeyColumn

protected Column getKeyColumn()
Description copied from class: CollectionProxy
Returns the column on the rows held by this object that contains the primary keys of the element type.

Overrides:
getKeyColumn in class CollectionProxy

iterator

public Iterator iterator()
Specified by:
iterator in interface Collection
Overrides:
iterator in class CollectionProxy


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/RelationshipProxy.html,v 1.9 2004/05/30 08:55:03 wbiggs Exp $