Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Initialize()
- {
- var dbFile = "test.sqlite";
- EnsureDbFileNotExists(dbFile);
- if (_configuration == null)
- {
- //_configuration = new Configuration().Configure(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "hibernate.config.xml"));
- //_configuration.AddAssembly(assemblyContainingMapping);
- _configuration = new Configuration()
- .SetProperty(Environment.Dialect, typeof(SQLiteDialect).AssemblyQualifiedName)
- .SetProperty(Environment.ConnectionDriver, typeof(SQLite20Driver).AssemblyQualifiedName)
- .SetProperty(Environment.ConnectionProvider, typeof(DriverConnectionProvider).AssemblyQualifiedName)
- .SetProperty(Environment.ConnectionStringName, string.Format("data source={0}", dbFile))
- .SetProperty(Environment.ShowSql, "true")
- .SetProperty(Environment.ProxyFactoryFactoryClass, typeof(ProxyFactoryFactory).AssemblyQualifiedName)
- .AddAssembly(assemblyContainingMapping);
- _sessionFactory = _configuration.BuildSessionFactory();
- }
- new SchemaExport(_configuration).Execute(true, true, false, GetSession().Connection, Console.Out);
- }
Add Comment
Please, Sign In to add comment