Class BOIterator<T extends BusinessObject>

java.lang.Object
com.primavera.integration.client.BOIteratorBase
com.primavera.integration.client.bo.BOIterator<T>
Type Parameters:
T - Any business object type
All Implemented Interfaces:
Iterator<T>

public class BOIterator<T extends BusinessObject> extends com.primavera.integration.client.BOIteratorBase implements Iterator<T>

An iterator over a business object collection. Loading multiple business objects always returns a BOIterator.

Not all business objects are necessarily loaded at one time. When many business objects are requested, the results are loaded from the server in subsets. Calling next() will therefore occasionally result in additional calls to the server when larger sets are requested.

  • Constructor Summary

    Constructors
    Constructor
    Description
    BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, com.primavera.bo.base.RemoteTXId txId)
    Class constructor used for when an empty BOIterator is needed.
    BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, String[] aIntgFieldName, ObjectId[] objIds, int iPageSize, com.primavera.bo.common.PRequestOptions opts, com.primavera.bo.base.RemoteTXId txId)
    Class constructor used when loading by ObjectId.
    BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, String[] aIntgFieldName, String sWhereClause, String sOrderBy, com.primavera.bo.common.PRequestOptions opts, com.primavera.bo.base.RemoteTXId txId)
    Class constructor used when loading with where clause and order by clause.
  • Method Summary

    Modifier and Type
    Method
    Description
    T[]
    Gets all business objects from loads that are known to have small result sets.
    int
    Returns the page size in use.
    boolean
    Indicates if the iterator has more elements.
    Gets the next business object in the iteration.
    void
    This method is not supported.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Constructor Details

    • BOIterator

      public BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, com.primavera.bo.base.RemoteTXId txId) throws BusinessObjectException
      Class constructor used for when an empty BOIterator is needed.
      Parameters:
      session - session object
      boDef - business object definition
      rowSet - row set returned from the first load
      Throws:
      BusinessObjectException
      IllegalArgumentException - if the input parameter is null or invalid
    • BOIterator

      public BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, String[] aIntgFieldName, String sWhereClause, String sOrderBy, com.primavera.bo.common.PRequestOptions opts, com.primavera.bo.base.RemoteTXId txId) throws BusinessObjectException
      Class constructor used when loading with where clause and order by clause.
      Parameters:
      session - session object
      boDef - business object definition
      rowSet - row set returned from the first load
      aIntgFieldName - array of field names
      sWhereClause - where clause
      sOrderBy - order by
      opts - request options
      Throws:
      BusinessObjectException
      IllegalArgumentException - if the input parameter is null or invalid
    • BOIterator

      public BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, String[] aIntgFieldName, ObjectId[] objIds, int iPageSize, com.primavera.bo.common.PRequestOptions opts, com.primavera.bo.base.RemoteTXId txId) throws BusinessObjectException
      Class constructor used when loading by ObjectId.
      Parameters:
      session - session object
      boDef - business object definition
      rowSet - row set returned from the first load
      aIntgFieldName - array of field names
      objIds - array of ObjectId
      iPageSize - page size
      opts - request options
      Throws:
      BusinessObjectException
      IllegalArgumentException - if the input parameter is null or invalid
  • Method Details

    • getPageSize

      public int getPageSize()
      Returns the page size in use.
      Returns:
      page size
    • hasNext

      public boolean hasNext()
      Indicates if the iterator has more elements.
      Specified by:
      hasNext in interface Iterator<T extends BusinessObject>
      Returns:
      boolean true if the iterator has more elements.
    • next

      public T next()
      Gets the next business object in the iteration.
      Specified by:
      next in interface Iterator<T extends BusinessObject>
      Returns:
      BusinessObject the business object
    • getAll

      Gets all business objects from loads that are known to have small result sets. It is recommended for performance reasons to not use this method but rather to use next() and iterate through all elements
      Returns:
      BusinessObject[] array of all business objects
      Throws:
      ServerException - if a problem occurred on the server-side
      NetworkException - if a problem occurred in the network layer
      BusinessObjectException - if a problem occurred in the client-side business objects
    • remove

      public void remove()
      This method is not supported. It will throw UnsupportedOperationException.
      Specified by:
      remove in interface Iterator<T extends BusinessObject>