I am storing a vast number of entries in a collection that's being persisted in a database.
Code:
@CollectionOfElements(fetch = FetchType.EAGER)
@LazyCollection(LazyCollectionOption.EXTRA)
private Set<String> newNoteIDs = new HashSet<String>();
public Iterator<String> getNewNoteIDsIterator()
{
return newNoteIDs.iterator();
}
My question, is whether or not this will allow me to use the iterator returned in order to look at single entries at a time? Or, is there a better way of getting "chunks" of the total collection without loading it entirely?