if (ob instanceof List) {
List ret = (List) ob;
if (ret instanceof ResultList) {
RuntimeExceptionTranslator trans = PersistenceExceptions.getRollbackTranslator(_em);
if (_query.isDistinct()) {
return new DistinctResultList((ResultList) ret, trans);
} else {
return new DelegatingResultList((ResultList) ret, trans);
}
} else {
return ret;