-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SchemaManager #399
Comments
As possible starting point for discussion, here's an API we recently added to Hibernate: public interface SchemaManager {
/**
* Export database objects mapped by Hibernate entities.
*
* @param createSchemas if {@code true}, attempt to create schemas,
* otherwise, assume the schemas already exist
*/
void exportMappedObjects(boolean createSchemas);
/**
* Drop database objects mapped by Hibernate entities, undoing the
* {@linkplain #exportMappedObjects(boolean) previous export}.
* <p>
* @param dropSchemas if {@code true}, drop schemas,
* otherwise, leave them be
*/
void dropMappedObjects(boolean dropSchemas);
/**
* Validate that the database objects mapped by Hibernate entities
* have the expected definitions.
*/
void validateMappedObjects();
/**
* Truncate the database tables mapped by Hibernate entities, and
* then re-import initial data from any configured
* {@linkplain org.hibernate.cfg.AvailableSettings#JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
* load script}.
*/
void truncateMappedObjects();
} Of course, |
Folks, please review #431 |
If we decide to do this, and if (Note that |
For testing, it's quite useful to have a programmatic way to perform schema management, instead of messing about with properties and creating/destroying the
EntityManagerFactory
.The text was updated successfully, but these errors were encountered: