java hibernate query.list返回空列表 [英] java hibernate query.list returns empty list

查看:85
本文介绍了java hibernate query.list返回空列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有JPA注释和Jboss事务管理器的休眠方式,我建立了会话工厂,打开了一个会话,并在使用query.list时创建了一个查询.list总是返回一个空列表

I am using hibernate with JPA annotations and Jboss transaction manager I build the session factory open up a session and create a query when i use query.list it always returns me an empty list

有什么主意吗?

推荐答案

一些建议:

persistence.xml中启用配置参数show-sql.试试这个,即

Enable configuration parameter show-sql in persistence.xml. Try this, i.e.

<property name="hibernate.show.sql" value="true" />

此外,最好使用来格式化

Furthermore, it is better to format that using,

<property name="hibernate.format_sql" value="true" />

然后尝试在某些SQL Client中运行相同的查询.

And then try to run the same query in some SQL Client.

这篇关于java hibernate query.list返回空列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆