de.mguennewig.pobjects
Class AbstractPObjJoin<T extends Record>

java.lang.Object
  extended by de.mguennewig.pobjects.AbstractPObjJoin<T>
Direct Known Subclasses:
PObjMap, PObjNestedSet, PObjSet, PObjStack

public abstract class AbstractPObjJoin<T extends Record>
extends java.lang.Object

Abstract wrapper object for joins between two tables.

Please note that the methods of this class resemble that of the standard Java collection classes, but that the semantics usually differ to some degree. In particular, every method call is an operation on the RDBMS, and the backing store's semantics do not follow those of Java. For example, given statement level read consistency on the RDBMS, a size() followed by a findAll().length may produce different results.

Even thought the methods of this class are synchronized is there still the chance for concurrent modifications made by other database users.

Author:
Michael Günnewig

Method Summary
 int clear()
          Removes all of the elements from this stack.
 T[] findAll()
          Return all the elements of the join, sorted by the primary key's columns.
 Container getContainer()
          Short cut for getParent().getContainer().
 java.lang.Class<? extends Record> getElementClass()
          Returns the class of the set's elements.
 ClassDecl getElementDecl()
          Returns the ClassDecl instance associated with the set's elements class.
 PObject getParent()
          Returns the parent object that owns this set and all its values.
 boolean isEmpty()
          Return true iff the set is empty.
 int size()
          Return the number of elements in the join.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParent

public final PObject getParent()
Returns the parent object that owns this set and all its values.


getElementClass

public final java.lang.Class<? extends Record> getElementClass()
Returns the class of the set's elements.

See Also:
getElementDecl()

getElementDecl

public final ClassDecl getElementDecl()
Returns the ClassDecl instance associated with the set's elements class.

See Also:
getElementClass()

getContainer

public final Container getContainer()
Short cut for getParent().getContainer().


findAll

public T[] findAll()
Return all the elements of the join, sorted by the primary key's columns.


size

public int size()
Return the number of elements in the join.


isEmpty

public boolean isEmpty()
Return true iff the set is empty.


clear

public int clear()
          throws PObjConstraintException,
                 PObjSQLException
Removes all of the elements from this stack.

Returns:
the number of set elements that were deleted.
Throws:
PObjConstraintException - if a database constraint will be violated
PObjSQLException - if any other database error occurs