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
ConstructorsConstructorDescriptionBOIterator(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 TypeMethodDescriptionT[]getAll()Gets all business objects from loads that are known to have small result sets.intReturns the page size in use.booleanhasNext()Indicates if the iterator has more elements.next()Gets the next business object in the iteration.voidremove()This method is not supported.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 objectboDef- business object definitionrowSet- row set returned from the first load- Throws:
BusinessObjectExceptionIllegalArgumentException- 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 objectboDef- business object definitionrowSet- row set returned from the first loadaIntgFieldName- array of field namessWhereClause- where clausesOrderBy- order byopts- request options- Throws:
BusinessObjectExceptionIllegalArgumentException- 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 objectboDef- business object definitionrowSet- row set returned from the first loadaIntgFieldName- array of field namesobjIds- array of ObjectIdiPageSize- page sizeopts- request options- Throws:
BusinessObjectExceptionIllegalArgumentException- 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:
hasNextin interfaceIterator<T extends BusinessObject>- Returns:
- boolean true if the iterator has more elements.
-
next
Gets the next business object in the iteration.- Specified by:
nextin interfaceIterator<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-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- 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:
removein interfaceIterator<T extends BusinessObject>
-