I am trying to figure out how to achieve the following from inside java code for one of our usage scenario: (we use using Spring / Hibernate 3.0)
1. Get the database / table information which contains the foreigh key and unique index constraint definition.
2. For each table foreign key / unique key fields obtained from step 1, what's the corresponding java field name / java data type programmatically. (Those are defined in the hibernate mapping file and I need to access those based on the database field information from step 1).
The apache DDLUtil package will give the foreign key, unique key index for each table in the whole database, but it does not know how each database field are mapped to the hibernate java object.
Any help will be greatly appreciated,
Thanks,
Mark
|