-
1. Re: Maven configuration required for Envers to work
ijabz Feb 22, 2012 8:53 AM (in response to ijabz)Oh man I have tried just about everythiung I can think of and still no audit tables being created, can anyone confirm that Envers even works when not using JPA and persistence.xml
-
2. Re: Maven configuration required for Envers to work
ijabz Feb 22, 2012 12:00 PM (in response to ijabz)Well it ocurred to me that the documentation glossed over creating the schema and didnt provide an example. Also there was nothing special I was doing when I called new SchemaExport(config).create(true, true) and I couldnt see how adding the event listeners or annotations would effect this.
Eventually I found the problem you have to add
config.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
to the configuration.
But this doesnt seem to be documented anywhere
Also it seems it now recreates hibernate classes when it first gets a SessionFactory I dont want it to recreate the hibernate tables everytime I stert my application, only when I call my recreatedb() method.