2 wbshuaiq wbshuaiq 于 2015.07.08 14:00 提问

hibernate sql输出问题

2015-07-08 11:28:00,085 [DefaultQuartzScheduler_Worker-9] DEBUG [org.hibernate.hql.ast.AST] - --- SQL AST ---
-[SELECT] QueryNode: 'SELECT' querySpaces (hc_vm_expiremail_log)
+-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
| +-[SELECT_EXPR] SelectExpressionImpl: 'vmexpireem0_.id as id32_'
| -[SQL_TOKEN] SqlFragment: 'vmexpireem0_.createTime as createTime32_, vmexpireem0_.mailId as mailId32_, vmexpireem0_.referenceId as referenc4_32_'
+-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[veel], fromElementByTableAlias=[vmexpireem0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
| -[FROM_FRAGMENT] FromElement: 'hc_vm_expiremail_log vmexpireem0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=veel,role=null,tableName=hc_vm_expiremail_log,tableAlias=vmexpireem0_,origin=null,colums={,className=com.hisoft.hscloud.vpdc.ops.entity.VmExpireEmailLog}}
-[WHERE] SqlNode: 'where'
-[AND] SqlNode: 'and'
+-[AND] SqlNode: 'and'
| +-[EQ] BinaryLogicOperatorNode: '='
| | +-[DOT] DotNode: 'vmexpireem0_.referenceId'
| | | +-[ALIAS_REF] IdentNode: 'vmexpireem0_.id'
| | | -[IDENT] IdentNode: 'referenceId'
| | -[NUM_INT] LiteralNode: '43'
| -[GT] BinaryLogicOperatorNode: '>'
| +-[DOT] DotNode: 'vmexpireem0_.createTime'
| | +-[ALIAS_REF] IdentNode: 'vmexpireem0_.id'
| | -[IDENT] IdentNode: 'createTime'
| -[QUOTED_STRING] LiteralNode: ''2015-05-15 17:13:15''
-[LT] BinaryLogicOperatorNode: '<'
+-[DOT] DotNode: 'vmexpireem0_.createTime'
| +-[ALIAS_REF] IdentNode: 'vmexpireem0_.id'
| -[IDENT] IdentNode: 'createTime'
-[QUOTED_STRING] LiteralNode: ''2015-07-08 11:28:00''

2015-07-08 11:28:00,085 [DefaultQuartzScheduler_Worker-9] DEBUG [org.hibernate.hql.ast.ErrorCounter] - throwQueryException() : no errors

控制台显示这样的信息是如何显示出来的

4个回答

ma751789547
ma751789547   2015.07.08 15:06

在配置数据源之类的时候配置一下即可。。。好像有一个show_sql之类的参数,true即可

ma751789547
ma751789547   2015.07.08 15:06

在配置数据源之类的时候配置一下即可。。。好像有一个show_sql之类的参数,true即可

abcd880129
abcd880129   2015.07.08 15:19

百度 hibernate+版本号+显示sql语句

wbshuaiq
wbshuaiq   2015.07.08 16:48

不是show_sql true
这个现实的是树形结构的,还带注释的。。

Csdn user default icon
上传中...
上传图片
插入图片