Business Components

oracle.jbo.server
Class QueryCollection

java.lang.Object
  |
  +--oracle.jbo.common.BaseObject
        |
        +--oracle.jbo.server.java.util.AbstractCollection
              |
              +--oracle.jbo.server.java.util.AbstractList
                    |
                    +--oracle.jbo.server.QueryCollection

public class QueryCollection
extends oracle.jbo.server.java.util.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

Fields inherited from class oracle.jbo.server.java.util.AbstractList
modCount
 
Fields inherited from class oracle.jbo.common.BaseObject
TRACE_EVERY_ALLOC, TRACE_NONE, TRACE_OCCASIONAL, TRACE_UNINITIALIZED
 
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.PCollPersistable elem)
           
protected  void afterRemove(EntityImpl entity)
          Removes the ViewRow from cache and collection
 void beforePassivateElement(oracle.jbo.pcoll.PCollPersistable elem)
           
protected  void finalize()
           
 java.lang.Object get(int index)
          Return the data at the index.
protected  int[] getIndexes(EntityImpl row)
           
 java.lang.String getName(java.lang.Object accessKey)
           
 long getNextObjId()
           
protected  Row[] getRows(EntityImpl row)
           
 oracle.jbo.server.ViewRowStorage getRowStorageFromId(long id)
           
 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.
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 oracle.jbo.server.java.util.AbstractList
add, addAll, equals, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, removeRange
 
Methods inherited from class oracle.jbo.server.java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class oracle.jbo.common.BaseObject
dumpState, setTraceLevel, setTraceWriter
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

beforePassivateElement

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

afterActivateElement

public void afterActivateElement(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).

Overrides:
size in class oracle.jbo.server.java.util.AbstractCollection
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.
Overrides:
get in class oracle.jbo.server.java.util.AbstractList
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.
Overrides:
set in class oracle.jbo.server.java.util.AbstractList
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.
Overrides:
add in class oracle.jbo.server.java.util.AbstractList
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.
Overrides:
remove in class oracle.jbo.server.java.util.AbstractList
Parameters:
index - the deletion index.
Returns:
the row removed.

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)
Overrides:
indexOf in class oracle.jbo.server.java.util.AbstractList

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

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

getName

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

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()
Overrides:
finalize in class java.lang.Object

Business Components