Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.server
Class QueryCollection

java.lang.Object
  extended bycom.sun.java.util.collections.AbstractCollection
      extended bycom.sun.java.util.collections.AbstractList
          extended byoracle.jbo.server.QueryCollection
All Implemented Interfaces:
com.sun.java.util.collections.Collection, com.sun.java.util.collections.List, oracle.jbo.pcoll.PCollListener

public class QueryCollection
extends com.sun.java.util.collections.AbstractList
implements oracle.jbo.pcoll.PCollListener

The QueryCollection represents the result of executing a ViewRow. The QueryCollection object will use the meta-data provided to "pull-apart" the rows of data that come back and locate/construct the appropriate Entity row definition.

In essense, it is a collection of ViewRow's.

Version:
INTERNAL

Field Summary
 
Fields inherited from class com.sun.java.util.collections.AbstractList
modCount
 
Method Summary
 void add(int index, java.lang.Object row)
          Add a row to the QueryCollection at the specified index.
 void afterActivateElement(oracle.jbo.pcoll.PCollection pcoll, oracle.jbo.pcoll.PCollPersistable elem)
           
protected  void afterRemove(EntityImpl entity)
          Removes the ViewRow from cache and collection
 void beforePassivateElement(oracle.jbo.pcoll.PCollection pcoll, oracle.jbo.pcoll.PCollPersistable elem)
           
 boolean equals(java.lang.Object qc)
           
protected  void finalize()
           
 java.lang.Object get(int index)
          Return the data at the index.
 java.lang.Object[] getFilterParamValues(ViewRowImpl viewRow, java.lang.Object[] newVals, int[] newValIndices)
           
protected  int[] getIndexes(EntityImpl row)
           
 java.lang.String getName(java.lang.Object accessKey)
           
 long getNextObjId()
           
 int getNumUserParams()
           
 RowFilter getRowFilter()
           
protected  Row[] getRows(EntityImpl row)
           
protected  Row[] getRows(Key ky)
           
 oracle.jbo.server.ViewRowStorage getRowStorageFromId(long id)
           
 int hashCode()
           
 int indexOf(java.lang.Object row)
           
 void printActiveObjsTab(java.io.PrintWriter pw)
           
 void printColl(java.io.PrintWriter pw, int printFlag)
           
 void printRUChain(java.io.PrintWriter pw)
           
 java.lang.Object remove(int index)
          Remove a row from the QueryCollection at the specified index.
 java.lang.Object removeAndRetain(int index)
           
 java.lang.Object removeFromCollection(int index)
           
protected  void removeReference(ViewRowImpl row, EntityImpl entity)
          Remove entity references, i.e, set references to null
 java.lang.Object set(int index, java.lang.Object element)
          Set the data at the index.
 int size()
          The size of the Collection.
protected  void updateReference(ViewRowImpl row, EntityImpl entity, int entityIndex)
          Set reference entity based on foreign keys
 
Methods inherited from class com.sun.java.util.collections.AbstractList
add, addAll, clear, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class com.sun.java.util.collections.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.java.util.collections.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Method Detail

beforePassivateElement

public void beforePassivateElement(oracle.jbo.pcoll.PCollection pcoll,
                                   oracle.jbo.pcoll.PCollPersistable elem)
Specified by:
beforePassivateElement in interface oracle.jbo.pcoll.PCollListener

afterActivateElement

public void afterActivateElement(oracle.jbo.pcoll.PCollection pcoll,
                                 oracle.jbo.pcoll.PCollPersistable elem)
Specified by:
afterActivateElement in interface oracle.jbo.pcoll.PCollListener

getNextObjId

public long getNextObjId()
Specified by:
getNextObjId in interface oracle.jbo.pcoll.PCollListener

size

public int size()
The size of the Collection. Implementation of the Collection interface.

--Calling this method will result in the entire Collection being --brought into memory (in order to give an accurate count of the --rows in it). THIS HAS CHANGED. THE NEW BEHAVIOR IS : We're currently returning only the fetched size of the query collection We could return the correct size, if atleast one row is fetched, however we should NOT return correct size if no rows are fetched (and thereby getting all rows in memory as AbstractList.hash() performs hasNext() that performs size() leading to fetching all row at the very beginning of iteration). - modified during move to AbstractList from Vector.

Specified by:
size in interface com.sun.java.util.collections.List
Returns:
the number of rows in the collection.

get

public java.lang.Object get(int index)
Return the data at the index. Implementation of the Collection interface.

Specified by:
get in interface com.sun.java.util.collections.List
Parameters:
index - the row index to use.
Returns:
the data at that row.

getRowStorageFromId

public oracle.jbo.server.ViewRowStorage getRowStorageFromId(long id)

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Set the data at the index. Implementation of the Collection interface.

Specified by:
set in interface com.sun.java.util.collections.List
Parameters:
index - the row index to use.
element - the value to put there.

add

public void add(int index,
                java.lang.Object row)
Add a row to the QueryCollection at the specified index.

Specified by:
add in interface com.sun.java.util.collections.List
Parameters:
index - the insertion index or -ve to insert at the end.
row - a ViewRow row to be inserted into the QueryCollection.

remove

public java.lang.Object remove(int index)
Remove a row from the QueryCollection at the specified index.

Specified by:
remove in interface com.sun.java.util.collections.List
Parameters:
index - the deletion index.
Returns:
the row removed.

removeFromCollection

public java.lang.Object removeFromCollection(int index)

removeAndRetain

public java.lang.Object removeAndRetain(int index)

getIndexes

protected int[] getIndexes(EntityImpl row)
Parameters:
row - to locate view rows which reference it.
Returns:
the row indexes of view rows

indexOf

public int indexOf(java.lang.Object row)
Specified by:
indexOf in interface com.sun.java.util.collections.List

afterRemove

protected void afterRemove(EntityImpl entity)
Removes the ViewRow from cache and collection


getRows

protected Row[] getRows(EntityImpl row)
Returns:
a list for ViewRows that reference the entity

getRows

protected Row[] getRows(Key ky)

removeReference

protected void removeReference(ViewRowImpl row,
                               EntityImpl entity)
Remove entity references, i.e, set references to null


updateReference

protected void updateReference(ViewRowImpl row,
                               EntityImpl entity,
                               int entityIndex)
Set reference entity based on foreign keys


getRowFilter

public RowFilter getRowFilter()

getNumUserParams

public int getNumUserParams()

getName

public java.lang.String getName(java.lang.Object accessKey)

getFilterParamValues

public java.lang.Object[] getFilterParamValues(ViewRowImpl viewRow,
                                               java.lang.Object[] newVals,
                                               int[] newValIndices)

printActiveObjsTab

public void printActiveObjsTab(java.io.PrintWriter pw)

printRUChain

public void printRUChain(java.io.PrintWriter pw)

printColl

public void printColl(java.io.PrintWriter pw,
                      int printFlag)

finalize

protected void finalize()

hashCode

public int hashCode()
Specified by:
hashCode in interface com.sun.java.util.collections.List

equals

public boolean equals(java.lang.Object qc)
Specified by:
equals in interface com.sun.java.util.collections.List

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

Copyright © 1997, 2004, Oracle. All rights reserved.