Is it possible to put comments into Hibernate Query Language? If so, how?
I think I agree. Does anyone have a definitive answer?
Thomas Bratt
2010-07-08 08:24:34
+1
A:
Make sure your session is configured with:
<property name="hibernate.use_sql_comments">true</property>
Then do:
Query query = ...;
query.setComment("Some comment here");
and you will see something like the following in your MySQL log file (if you're using MySQL):
5998 Query /* Some comment here */ select .....
Hisham
2010-07-13 19:40:50
+1 For the nice tip! I wanted comments in the source but this is close :)
Thomas Bratt
2010-07-28 16:28:30