是否可以将注释放入 Hibernate 查询语言中?如果是,怎么办?
最佳答案
确保您的 session 配置为:
<property name="hibernate.use_sql_comments">true</property>
然后做:
Query query = ...;
query.setComment("Some comment here");
您将在 MySQL 日志文件中看到如下内容(如果您使用的是 MySQL):
5998 Query /* Some comment here */ select .....
关于database - 如何将评论放入 HQL(Hibernate 查询语言)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3196975/