* @param defaultEntity an entity needed to build ObjectIds for distinct comparison.
*/
public DistinctResultIterator(ResultIterator wrappedIterator, DbEntity defaultEntity,
boolean compareFullRows) throws CayenneException {
if (wrappedIterator == null) {
throw new CayenneException("Null wrapped iterator.");
}
if (defaultEntity == null) {
throw new CayenneException("Null defaultEntity.");
}
this.wrappedIterator = wrappedIterator;
this.defaultEntity = defaultEntity;
this.fetchedIds = new HashSet<Map<String, Object>>();