Reference‎ > ‎The recompute utility‎ > ‎

Running Recompute using the API

You can integrate the Recompute utility into your own Java programs using the published API.

The process is fairly simple. You'll need to first create a Configuration object, in which you will set up all the parameters required to run, such as the location of the Hibernate configuration file, the output file name, etc... If you want to use an existing configuration file, you can use Configuration.readFromFile to read it.

You will then create a new instance of Engine (passing it the Configuration), and invoke either scan() or fix().

If you want to have the plan behavior (i.e. generate the HQL but do not actually run them), you will call Configuration.setSqlOnly(true) before invoking Engine.fix(). This will instruct the engine to not actually change any data in the database.


Comments