java hibernate query.list returns empty list

杀马特。学长 韩版系。学妹 提交于 2019-12-12 00:58:33

问题


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

any idea?


回答1:


Few suggestions:

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" />

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



来源:https://stackoverflow.com/questions/6841113/java-hibernate-query-list-returns-empty-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!