Package org.hibernate.relational
Interface SchemaManager
- All Superinterfaces:
SchemaManager
- All Known Implementing Classes:
SchemaManagerImpl
Allows programmatic schema export,
schema validation,
data cleanup, and
schema cleanup as a convenience for
writing tests.
- Since:
- 6.2
- See Also:
- API Note:
- This interface was added to JPA 3.2 as
SchemaManager, which it now inherits, with a minor change to the naming of its operations. It is retained for backward compatibility and as a place to define additional functionality in the future.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddropMappedObjects(boolean dropSchemas) Drop database objects mapped by Hibernate entities, undoing the previous export.voidexportMappedObjects(boolean createSchemas) Export database objects mapped by Hibernate entities.voidpopulate()Populate the database by executing/import.sqland any other configured load script.voidTruncate the database tables mapped by Hibernate entities, and then reimport initial data from/import.sqland any other configured load script.voidValidate that the database objects mapped by Hibernate entities have the expected definitions.Methods inherited from interface jakarta.persistence.SchemaManager
create, drop, truncate, validate
-
Method Details
-
exportMappedObjects
void exportMappedObjects(boolean createSchemas) Export database objects mapped by Hibernate entities.Programmatic way to run
SchemaCreator.- Parameters:
createSchemas- iftrue, attempt to create schemas, otherwise, assume the schemas already exist- API Note:
- This operation is a synonym for
SchemaManager.create(boolean).
-
dropMappedObjects
void dropMappedObjects(boolean dropSchemas) Drop database objects mapped by Hibernate entities, undoing the previous export.Programmatic way to run
SchemaDropper.- Parameters:
dropSchemas- iftrue, drop schemas, otherwise, leave them be- API Note:
- This operation is a synonym for
SchemaManager.drop(boolean).
-
validateMappedObjects
void validateMappedObjects()Validate that the database objects mapped by Hibernate entities have the expected definitions.Programmatic way to run
SchemaValidator.- API Note:
- This operation is a synonym for
SchemaManager.validate().
-
truncateMappedObjects
void truncateMappedObjects()Truncate the database tables mapped by Hibernate entities, and then reimport initial data from/import.sqland any other configured load script.Programmatic way to run
SchemaTruncator.- API Note:
- This operation is a synonym for
SchemaManager.truncate().
-
populate
Populate the database by executing/import.sqland any other configured load script.Programmatic way to run
SchemaPopulator.- Since:
- 7.0
-