Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

LocalSessionFactoryObject.UpdateDatabaseSchema Method

Execute schema update script, determined by the Configuration object used for creating the SessionFactory. A replacement for NHibernate's SchemaUpdate class, for automatically executing schema update scripts on application startup. Can also be invoked manually.

[Visual Basic]
Public Overridable Sub UpdateDatabaseSchema()
[C#]
public virtual void UpdateDatabaseSchema();

Remarks

Fetch the LocalSessionFactoryObject itself rather than the exposed SessionFactory to be able to invoke this method, e.g. via

LocalSessionFactoryObject lsfo = (LocalSessionFactoryObject) ctx.GetObject("mySessionFactory");
.

Uses the SessionFactory that this bean generates for accessing a ADO.NET connection to perform the script.

See Also

LocalSessionFactoryObject Class | Spring.Data.NHibernate Namespace