Search in sources :

Example 1 with GenericResultSetClosedException

use of org.apache.ofbiz.entity.GenericResultSetClosedException in project ofbiz-framework by apache.

the class EntityListIterator method currentGenericValue.

/**
 * NOTE: Calling this method does return the current value, but so does calling next() or previous()
 *  So calling one of those AND this method will cause the value to be created twice.
 */
public GenericValue currentGenericValue() throws GenericEntityException {
    if (closed)
        throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed");
    GenericValue value = GenericValue.create(modelEntity);
    value.setDelegator(this.delegator);
    for (int j = 0; j < selectFields.size(); j++) {
        ModelField curField = selectFields.get(j);
        SqlJdbcUtil.getValue(resultSet, j + 1, curField, value, modelFieldTypeReader);
    }
    value.synchronizedWithDatasource();
    this.haveMadeValue = true;
    return value;
}
Also used : GenericValue(org.apache.ofbiz.entity.GenericValue) ModelField(org.apache.ofbiz.entity.model.ModelField) GenericResultSetClosedException(org.apache.ofbiz.entity.GenericResultSetClosedException)

Aggregations

GenericResultSetClosedException (org.apache.ofbiz.entity.GenericResultSetClosedException)1 GenericValue (org.apache.ofbiz.entity.GenericValue)1 ModelField (org.apache.ofbiz.entity.model.ModelField)1