I have a query that is not producing any results even though there is definitely data in the underlying database corresponding with the query. The query is being run by Hibernate, and I want to validate it by running the query directly in MySQL. How can I translate from Hibernate to SQL so that I can see if the query produces any results?
Here is the Hibernate query that the Eclipse console says is being run:
select
drugword0_.name as name1_12_2_,
concepts1_.word as word1_12_4_,
drugconcep2_.rxcui as rxcui2_13_4_,
drugconcep2_.rxcui as rxcui1_10_0_,
atoms3_.rxcui as rxcui3_10_5_,
atoms3_.rxaui as rxaui1_39_5_,
atoms3_.rxaui as rxaui1_39_1_,
atoms3_.rxcui as rxcui3_39_1_,
atoms3_.str as str2_39_1_
from drugwords drugword0_
left outer join drugwordsconsoJunction concepts1_ on drugword0_.name=concepts1_.word
left outer join drugconcepts drugconcep2_ on concepts1_.rxcui=drugconcep2_.rxcui
left outer join rxnconso atoms3_ on drugconcep2_.rxcui=atoms3_.rxcui where drugword0_.name=?
How do I convert that Hibernate query into working syntax for a sql query of a MySQL database? And why do you think my Hibernate query is not returning any results? Are the Hibernate mappings set up incorrectly?