Does anyone know if there are any resources/documentation on using the hibernate-tools.jar classes directly (i.e. not through the Ant tasks or plugin)? I have an application where there are a number of known entities which are mapped (using JPA annotations), and there will also be a number of mappings which we need to be able to create at runtime. It seems this is possible using non-POJO mappings which Hibernate returns as Maps. We have to allow users to easily create these mappings though, and it seems a shame to build something proprietary when there is already a good tool to extract mappings (including relationships and other complex stuff). We need to be able to connect to the same database as the current Hibernate Session would and do the following;
1. Provide a list of (possibly filtered) tables in the database.
2. Reverse engineer specific tables *into some in-memory structure*
3. Save the result back into the database
4. Retrieve it at some later point, to be merged into the Configuration which creates the SessionFactory
Any ideas or pointers would be greatly appreciated.
|