com.ibm.websphere.wdo
Interface DataListAccessBean

All Superinterfaces:
java.util.Collection, java.util.List, java.io.Serializable

public interface DataListAccessBean
extends java.util.List, java.io.Serializable

Websphere Data Objects - DataListAccessBean Implementation

This interface defines the interface to a DataList. A DataList is an object that represents a view onto a collection of DataObjects. The DataObjects themselves are described by a separate object, an IDataObject.

DataListAccessBean has the following reponsibilities


Assumptions:


Field Summary
static int ASCENDING
           
static int DESCENDING
           
static int UNSORTED
           
 
Method Summary
 void addOrderBy(java.lang.String name, int direction)
          Adds an orderBy to order results by a property in a given direction Orderby is added to the front of the order-by list; If name previously existed in Order By List, it is moved to the front of the order-by list.
 void clearOrderBy()
          Removes all orderBy clauses set through the addOrderBy API
 void close()
          Releases any resources, such as database cursors, being held by the DataList for the current page
 void commit()
          Commits any changes made by calls to put
 DataObjectAccessBean createNewDataObject()
          Creates a new DataObjectAccessBean of the Type held by this Collection.
 void emptyDataGraph()
          Creates new empty datagraph
 void execute()
          executes the query and fills the DataList with the first Page of Data
 void execute(java.util.Map params)
          Executes the query and fills the DataList with the first Page of Data
 void firstPage()
          Moves to the first page of DataObjects
 java.lang.String getAction()
          get the default action upon initialization of this data list (fill/empty/none)
 DataObjectAccessBean getDataObjectAccessBean(int index)
          Returns the element at the specified position in this list.
 java.lang.Long getNextGeneratedKey()
          Get the next Key Value from the Auto Key Generator
 boolean getPagination()
          Returns whether or not this DataList is paginating the results
 java.util.Map getParams()
          Return the current parameters that are used during execution
 int getTargetPageSize()
          Return the desired number of DataObjects to return per page.
 void nextPage()
          resets the position of the DataList so that on the next iteration, the next page of DataObjects will be returned.
 void previousPage()
          resets the position of the DataList so that on the next iteration, the previous page of DataObjects will be returned.
 void removeOrderBy(java.lang.String name)
          Removes an Order By added for a given property
 void setAction(java.lang.String action)
          Set the default action upon initialization of this data list (fill/empty/none)
 void setPagination(boolean pagination)
          Specify whether or not this DataList shoulds paginate results
 void setParams(java.util.Map map)
          Set the current parameters that are used during execution
 void setTargetPageSize(int targetPagesize)
          Specify the desired number of DataObjects per page.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

UNSORTED

public static final int UNSORTED
See Also:
Constant Field Values

ASCENDING

public static final int ASCENDING
See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
See Also:
Constant Field Values
Method Detail

addOrderBy

public void addOrderBy(java.lang.String name,
                       int direction)
                throws java.lang.UnsupportedOperationException,
                       com.ibm.websphere.wdo.mediator.exception.MediatorException,
                       java.io.IOException
Adds an orderBy to order results by a property in a given direction Orderby is added to the front of the order-by list; If name previously existed in Order By List, it is moved to the front of the order-by list.

Parameters:
name - name of column to order by.
direction - directional order to sort by: DataListAccessBean.UNSORTED, DataListAccessBean.ASCENDING, DataListAccessBean.DESCENDING
Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException
java.lang.UnsupportedOperationException
java.io.IOException

clearOrderBy

public void clearOrderBy()
                  throws java.lang.UnsupportedOperationException,
                         com.ibm.websphere.wdo.mediator.exception.MediatorException,
                         java.io.IOException
Removes all orderBy clauses set through the addOrderBy API

Throws:
java.lang.UnsupportedOperationException
com.ibm.websphere.wdo.mediator.exception.MediatorException
java.io.IOException

close

public void close()
           throws com.ibm.websphere.wdo.mediator.exception.MediatorException
Releases any resources, such as database cursors, being held by the DataList for the current page

Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

commit

public void commit()
            throws com.ibm.websphere.wdo.mediator.exception.MediatorException
Commits any changes made by calls to put

Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

createNewDataObject

public DataObjectAccessBean createNewDataObject()
                                         throws com.ibm.websphere.wdo.mediator.exception.MediatorException
Creates a new DataObjectAccessBean of the Type held by this Collection. The created DataObject is added to this DataList by default.

Returns:
the created DataObjectAccessBean
Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

execute

public void execute()
             throws com.ibm.websphere.wdo.mediator.exception.MediatorException
executes the query and fills the DataList with the first Page of Data

Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

emptyDataGraph

public void emptyDataGraph()
                    throws com.ibm.websphere.wdo.mediator.exception.MediatorException
Creates new empty datagraph

Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

execute

public void execute(java.util.Map params)
             throws com.ibm.websphere.wdo.mediator.exception.MediatorException
Executes the query and fills the DataList with the first Page of Data

Parameters:
params - takes a Map of input parameters to pass to the executing query
Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

getParams

public java.util.Map getParams()
Return the current parameters that are used during execution

Returns:
map of the current parameters that are used during execution

setParams

public void setParams(java.util.Map map)
Set the current parameters that are used during execution

Parameters:
map - of parameters to be used during execution

firstPage

public void firstPage()
               throws com.ibm.websphere.wdo.mediator.exception.MediatorException
Moves to the first page of DataObjects

Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

getDataObjectAccessBean

public DataObjectAccessBean getDataObjectAccessBean(int index)
                                             throws java.lang.IndexOutOfBoundsException,
                                                    com.ibm.websphere.wdo.mediator.exception.MediatorException
Returns the element at the specified position in this list.

Parameters:
index - index of element to return.
Returns:
the element at the specified position in this list.
Throws:
java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
com.ibm.websphere.wdo.mediator.exception.MediatorException

getPagination

public boolean getPagination()
Returns whether or not this DataList is paginating the results

Returns:
true if this list is paginating results

getTargetPageSize

public int getTargetPageSize()
Return the desired number of DataObjects to return per page.

Returns:
the targeted page size

nextPage

public void nextPage()
              throws com.ibm.websphere.wdo.mediator.exception.MediatorException
resets the position of the DataList so that on the next iteration, the next page of DataObjects will be returned. Pagination is usually implemented by sorting the output, and remembering the values of the sort columns of the first/last DataObject of each page. When fetching the DataObjects for a page, the DataList will append a clause along the lines of " GTR "

Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

previousPage

public void previousPage()
                  throws com.ibm.websphere.wdo.mediator.exception.MediatorException
resets the position of the DataList so that on the next iteration, the previous page of DataObjects will be returned.

Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException

removeOrderBy

public void removeOrderBy(java.lang.String name)
                   throws java.lang.UnsupportedOperationException,
                          com.ibm.websphere.wdo.mediator.exception.MediatorException
Removes an Order By added for a given property

Parameters:
name - name of column to be removed from order-by list.
Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException
java.lang.UnsupportedOperationException

setPagination

public void setPagination(boolean pagination)
Specify whether or not this DataList shoulds paginate results

Parameters:
pagination - set whether to paginate results

setTargetPageSize

public void setTargetPageSize(int targetPagesize)
Specify the desired number of DataObjects per page. The resultSet cannot stop between two DataObjects with identical values in the sort columns, so more DataObjects may be returned

Parameters:
targetPagesize - the desired number of DataObjects per page

setAction

public void setAction(java.lang.String action)
Set the default action upon initialization of this data list (fill/empty/none)

Parameters:
action - the default action to perform upon initialization of this data list

getAction

public java.lang.String getAction()
get the default action upon initialization of this data list (fill/empty/none)

Returns:
default action upon initialization of this data list

getNextGeneratedKey

public java.lang.Long getNextGeneratedKey()
                                   throws com.ibm.websphere.wdo.mediator.exception.MediatorException
Get the next Key Value from the Auto Key Generator

Returns:
next Key Value from the Auto Key Generator
Throws:
com.ibm.websphere.wdo.mediator.exception.MediatorException