Class SharedEntityBatcherIterable<S extends SharedEntity>

java.lang.Object
com.atlassian.jira.sharing.SharedEntityBatcherIterable<S>
All Implemented Interfaces:
EnclosedIterable<S>, Sized

public class SharedEntityBatcherIterable<S extends SharedEntity> extends Object implements EnclosedIterable<S>
An iterable that fetches shared entities in batches from the database. Each batch is loaded directly to the memory and the DB is queried only when the current batch is exhausted. The DB connection isn't kept during batch processing.
  • Constructor Details

    • SharedEntityBatcherIterable

      public SharedEntityBatcherIterable(OfBizDelegator delegator, String table, org.ofbiz.core.entity.EntityCondition condition, Function<org.ofbiz.core.entity.GenericValue,S> entityResolver, int batchSize)
      Creates a new instance of SharedEntityBatcherIterable.
      Parameters:
      delegator - the OfBizDelegator that will be used for querying the database
      table - the table name to fetch data from
      condition - optional condition to filter data. If null, no condition will be applied.
      entityResolver - the function to convert a GenericValue to an instance of S
      batchSize - the size of the single batch used to iterate over the data. Must be positive value.
    • SharedEntityBatcherIterable

      public SharedEntityBatcherIterable(OfBizDelegator delegator, String table, Function<org.ofbiz.core.entity.GenericValue,S> entityResolver, int batchSize)
      Creates a new instance of SharedEntityBatcherIterable.
      Parameters:
      delegator - the OfBizDelegator that will be used for querying the database
      table - the table name to fetch data from
      entityResolver - the function to convert a GenericValue to an instance of S
      batchSize - the size of the single batch used to iterate over the data. Must be positive value.
  • Method Details