Our application is developed on Java over Play! 1.2.4. We’re using JPA over Hibernate for our ORM.
As per Play!’s default configuration, our dev environment has DDL set to false, and prod environments have it set to true.
Up until now, changes in the DB require us to write SQL scripts to be run on production, by either a) knowing what changed, and adding it to script files, or b) examining the DB manually to code the deltas.
It would be nice if we could get a log of all the DDL operations that were executed by Hibernate, saving us the typing and manual verification.
I cannot find any information about this on the Play! or Hibernate documentation.
I’ve tried setting this on the application.conf with no luck:
jpa.debugSQL=true
I can see the Select operations, but no DDL.
Hibernate has several log categories that can be set in log4j.properties.
If you don’t use log4j.properties create one as described here.
Then you need a list of hibernate log categories, you can find them here.
For example, if you want to log DDL statements you should add the following lines to the log4j.properties file:
Also you might find jpa.ddl parameter usefull, see Play documentation for more info.