};
iterator.setSession(this);
iterator.setCascadeDepth(cascadeDepth);
if (forDetach){
CascadeCondition detached = iterator.new CascadeCondition(){
public boolean shouldNotCascade(DatabaseMapping mapping){
return ! (mapping.isForeignReferenceMapping() && ((ForeignReferenceMapping)mapping).isCascadeDetach());
}
};
iterator.setCascadeCondition(detached);