开发者

java hibernate query.list returns empty list

开发者 https://www.devze.com 2023-03-23 17:53 出处:网络
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.li开发者_运维技巧st it always returns me an em

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.li开发者_运维技巧st it always returns me an empty list

any idea?


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.


If you are adding values in the database from the command prompt manually, perform the commit operation after insertion. especially in oracle DB

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号