0

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?

2
  • show the source; check the query returns data Commented Jul 27, 2011 at 7:55
  • Check the generated SQL, make sure your query should return any data. Commented Jul 27, 2011 at 8:01

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

no query is printed <property name="show_sql">true</property>
@slimshady: I modified the answer to include the property configuration. Cheers.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.