ITeye博客

No Dialect mapping for JDBC type: -1

bawking · 2011-07-18 13:58 · java · 数据库 · SQL · XML · Hibernate · Markdown

@SuppressWarnings("unchecked") public List findAll(final int... rowStartIdxAndCount) { LogUtil.log("finding all ReturnDidQuery instances", Level.INFO, null); try { final String queryString = "select model from ReturnDidQuery model"; Query query = entityManager.createQuery(queryString); if (rowStartIdxAndCount != null && rowStartIdxAndCount.length > 0) { int rowStartIdx = Math.max(0, rowStartIdxAndCount[0]); if (rowStartIdx > 0) { query.setFirstResult(rowStartIdx); } if (rowStartIdxAndCount.length > 1) { int rowCount = Math.max(0, rowStartIdxAndCount[1]); if (rowCount > 0) { query.setMaxResults(rowCount); } } } return query.getResultList(); } catch (RuntimeException re) { LogUtil.log("find all failed", Level.SEVERE, re); throw re; } } 网上搜索,发现这个问题很多,和异常的说明一致,方言声明问题,但是这并不是第一个有参的存储过程调用,其他的都完好,唯独这。。。。 persistence.xml中加入方言已经ok,先mark下,有时间再看看问题在哪?

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。