标签:factor rac single turn int cep hql ack try
public static <T> T get(String hql, Class<T> t) {
EntityManager em = getFactory().createEntityManager();
try {
return em.createQuery(hql, t).getSingleResult();
} catch (NoResultException e) {
e.printStackTrace();
return null;
} finally {
em.close();
}
}
getSingleResult();
结果多于一个 就报异常
使用Spring Data JPA查询时,报result returns more than one elements异常
标签:factor rac single turn int cep hql ack try
原文地址:http://www.cnblogs.com/fengyifengceaser/p/6244382.html