见源码:
public List executeFind(HibernateCallback<?> action) throws DataAccessException {
Object result = doExecute(action, false, false);
if (result != null && !(result instanceof List)) {
throw new InvalidDataAccessApiUsageException(
"Result object returned from HibernateCallback isn't a List: [" + result + "]");
}
return (List) result;
}
本文解析了Hibernate中通过回调执行查询的方法。重点介绍了executeFind方法如何处理查询结果,并确保返回值为List类型。若返回结果不是List,则抛出InvalidDataAccessApiUsageException异常。
1068

被折叠的 条评论
为什么被折叠?



