java - Getting SQL script from Hibernate update -


i'm looking way sql update script when hibernate automatically updates tables.

i'm using hibernate.hbm2ddl.auto=update in development environment only, , need sql script updates tables production.

i want these sql scripts in txt format revision , potential edit.

how can done? advice.

there suggestions , general discussion here.

in nutshell, can turn on logging (to standard output):

hibernate.show_sql=true 

alternatively, if use log4j, can add log4j.properties file:

log4j.logger.org.hibernate.sql=debug 

both of these approaches going output hibernate's prepared statements parameters (so parameter values not inline). around this, use interceptor p6spy. details on can found here.


Comments