How do I determine if the tables defined in the hibernate.cfg.xml file have already been created in the database?
Here are the requirements that necessitate this:
I need to write a Java program that reads the hibernate.cfg.xml, checks if the tables defined there exist in the DB; create the tables only if they do not already exist.
Due to some restrictions in our project, we cannot use the ant tool for this purpose; hence the need for a custom program that internally does make use of the SchemaExport class.
Any help is greatly appreciated.
Hibernate version: 3.0.2
Name and version of the database you are using: Postgres 8.0, Oracle 10g
|