You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's create-, drop- and updateDatabaseSchema() operations in LocalSessionFactoryBean. For completeness, add validateDatabaseSchema(). This is useful if your application doesn't have permissions to modify the schema itself. If using hibernate, one cannot auto-validate the scema in a webapplication because context loading would fail with HibernateException if schema has changed, so the application would need to validate the schema at a later point. You could also consider adding a strategy for supporting hibernate.hbm2ddl.auto=validate.
In Hibernate, schema validation can be performed with:
SchemaValidator validator = new SchemaValidator(configuration);
validator.validate();
Hello,
LocalSessionFactoryBean.validateDatabaseSchema() exists for hibernate 3 (package org.springframework.orm.hibernate3) but doesn't for hibernate 4 (org.springframework.orm.hibernate4).
Do you plan to implement It also for hibernate 4 or is there any other mechanism that can do the trick ? (eg : hibernate.hbm2ddl.auto).
Kalle Korhonen opened SPR-3212 and commented
There's create-, drop- and updateDatabaseSchema() operations in LocalSessionFactoryBean. For completeness, add validateDatabaseSchema(). This is useful if your application doesn't have permissions to modify the schema itself. If using hibernate, one cannot auto-validate the scema in a webapplication because context loading would fail with HibernateException if schema has changed, so the application would need to validate the schema at a later point. You could also consider adding a strategy for supporting hibernate.hbm2ddl.auto=validate.
In Hibernate, schema validation can be performed with:
SchemaValidator validator = new SchemaValidator(configuration);
validator.validate();
Thread this is discussed:
http://forum.springframework.org/showthread.php?t=35274
Affects: 2.0.2
Referenced from: commits b370969
3 votes, 3 watchers
The text was updated successfully, but these errors were encountered: