com.objectwave.persist
Interface CollectionAdapter

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ArrayListCollectionAdapter, HashMapCollectionAdapter, HashtableCollectionAdapter, LinkedListCollectionAdapter, VectorCollectionAdapter

public interface CollectionAdapter
extends java.io.Serializable

This class enables the generic persistence framework to support multiple collection types.

Version:
1.1
Author:
Dave Hoag

Method Summary
 void addElement(java.lang.Object obj)
          Add the object to this collection.
 java.lang.Object firstElement()
           
 java.lang.Object getCollectionObject()
          Get the actual collection object.
 CollectionAdapter getNewInstance()
          Invoked when a new instance is needed.
 void preQuery(SQLQuery q)
          An entry point to tweak the query before issuing the find.
 int size()
          The number of elements in the collection.
 

Method Detail

preQuery

public void preQuery(SQLQuery q)
An entry point to tweak the query before issuing the find. This will be a noop for most CollectionAdapters.

Parameters:
q -

getNewInstance

public CollectionAdapter getNewInstance()
Invoked when a new instance is needed. This could simply return 'this'. This is called when creating the SQLQuery that will realize a collection attribute. Normally, this method is not invoked, only when a CollectionAdapter is associated with an AttributeTypeColumn.

Returns:
The NewInstance value

getCollectionObject

public java.lang.Object getCollectionObject()
Get the actual collection object.

Returns:
Object that is the 'collection'

addElement

public void addElement(java.lang.Object obj)
Add the object to this collection.

Parameters:
obj - The feature to be added to the Element attribute

size

public int size()
The number of elements in the collection.

Returns:

firstElement

public java.lang.Object firstElement()
Returns: