Exemplo n.º 1
0
        public void BuildSchema()
        {
            ISession session = CreateSession();
            IDbConnection connection = session.Connection;

            var dialect = new MsSql2008Dialect();
            string[] drops = _configuration.GenerateDropSchemaScript(dialect);
            ExecuteScripts(drops, connection);

            string[] scripts = _configuration.GenerateSchemaCreationScript(dialect);
            ExecuteScripts(scripts, connection);
        }
Exemplo n.º 2
0
		private void VerifyMapping(HbmMapping mapping)
		{
			var dialect = new MsSql2008Dialect();
			var configuration = new Configuration();
			var mappings = configuration.CreateMappings(dialect);
			mappings.DefaultAssembly = "NHibernate.Test";
			mappings.DefaultNamespace = "NHibernate.Test.NHSpecificTest.NH1007";

			var rootBinder = new MappingRootBinder(mappings, dialect);
			rootBinder.Bind(mapping);

			var employer = rootBinder.Mappings.GetClass("NHibernate.Test.NHSpecificTest.NH1007.Employer1");
			var simpleValue = employer.Identifier as SimpleValue;
			if (simpleValue != null)
			{
				Assert.That(simpleValue.IdentifierGeneratorStrategy, Is.EqualTo("guid"));
				Assert.That(simpleValue.IdentifierGeneratorProperties, Is.Empty);
			}
		}