BuildSchema() public method

public BuildSchema ( ) : void
return void
 public void RecreateDb(ISession session)
 {
     InitSessionFactory();
     var sessionSource = new SessionSource(_fluentConfiguration);
     sessionSource.BuildSchema(session);
     session.Flush();
 }
Esempio n. 2
0
 public void AutoCriarBancoDeDados(ISession session)
 {
     InitSessionFactory();
     var sessionSource = new SessionSource(_fluentConfiguration);
     sessionSource.BuildSchema(session);
     session.Flush();
 }
Esempio n. 3
0
        public Form1( )
        {
            InitializeComponent();

              if (!File.Exists("SiqualRunner.db"))
              {
            ISessionSource s = new SessionSource(new SQLRPersistenceModel());
            s.BuildSchema();
              }

              toolTip1.SetToolTip(chkRunAtomic, "All files are ran in one transaction.");

              PrepareGridView();
              InitPanels();

              Closing += Form1Closing;
              gvFileList.MouseUp += GvFileListMouseUp;
              notifyIcon.Click += NotifyIconClick;
              Resize += Form1Resize;

              lstProjects.DrawMode = DrawMode.OwnerDrawVariable;
              lstProjects.DrawItem += ListBox1DrawItem;
              lstProjects.MeasureItem += ListBox1MeasureItem;

              _timer.Interval = 1000 * 60 * 3; // 3 minutes
              _timer.Enabled = true;
              _timer.Tick += TimerTick;
              _timer.Start();
        }
Esempio n. 4
0
 protected virtual void Before_each_test()
 {
     SessionSource = new SessionSource(new TestModel());
     Session = SessionSource.CreateSession();
     SessionSource.BuildSchema(Session);
     CreateInitialData(Session);
     Session.Clear();
 }
Esempio n. 5
0
        public void SetupContext()
        {
            var cfg = Fluently.Configure().Database(SQLiteConfiguration.Standard.InMemory);

            SessionSource = new SessionSource(cfg.BuildConfiguration().Properties, new TestModel());
            Session = SessionSource.CreateSession();
            SessionSource.BuildSchema(Session);
        }
 public void AutoCriarBancoDeDados()
 {
     if (_fluentConfiguration != null)
     {
         var sessionSource = new SessionSource(_fluentConfiguration);
         ISession session = sessionSource.CreateSession();
         sessionSource.BuildSchema(session);
     }
 }
 protected virtual void Context()
 {
     SessionSource = new SessionSource(new TestModel());
     Session = SessionSource.CreateSession();
     SessionSource.BuildSchema(Session);
     CreateInitialData(Session);
     Session.Flush();
     Session.Clear();
 }
        public void Setup()
        {
            var model = NHibernateHelper.SkapaPeristanceModel();

            var cfg = Fluently.Configure()
                .Database(SQLiteConfiguration.Standard.ShowSql().InMemory);

            _sessionSource = new SessionSource(cfg.BuildConfiguration().Properties, model);

            _sessionHelper = new SQLiteSessionHelper(_sessionSource);
            _sessionHelper.StartSession();
            _sessionSource.BuildSchema(_sessionHelper.GetCurrentSession());
        }
        public ISessionSource GetSessionSource()
        {
            var config = _mappings.Generate()
                .Database(SQLiteConfiguration.Standard.InMemory()
                              .ProxyFactoryFactory(typeof(NHibernate.ByteCode.LinFu.ProxyFactoryFactory)))
                .ExposeConfiguration(EventListenerRegistrations.Apply);

            var sessionSource = new SessionSource(config);

            if (ShouldGenerateDb)
                sessionSource.BuildSchema();

            return sessionSource;
        }
        public ISessionSource GetSessionSource()
        {
            var config = _mappings.Generate()
                .Database(MsSqlConfiguration.MsSql2008.ConnectionString(_connectionString)
                              .ProxyFactoryFactory(typeof (NHibernate.ByteCode.LinFu.ProxyFactoryFactory)))
                              .ExposeConfiguration(EventListenerRegistrations.Apply);
             
        
            var sessionSource = new SessionSource(config);


            if (ShouldGenerateDb)
                sessionSource.BuildSchema();

            return sessionSource;
        }
        public void SetUp()
        {
            FluentConfiguration config = Fluently
                .Configure()
                .Database(SQLiteConfiguration.Standard.InMemory().ShowSql())
                .Mappings(
                    m =>
                        {
                            m.FluentMappings.AddFromAssemblyOf<Vehicle>();
                            m.AutoMappings.Add(
                                AutoMap
                                    .AssemblyOf<Plant>()
                                    .Where(x => x.Namespace == "Fluent.Entities"));
                        });

            _sessionSource = new SessionSource(config);
            _session = _sessionSource.CreateSession();
            _sessionSource.BuildSchema(_session);
        }
Esempio n. 12
0
        /// <summary>
        /// Returns the FluentNHibernate Sqlite configuration data
        /// </summary>
        /// <param name="assembly">The assembly containing the mappings</param>
        /// <returns>SQLite configuration</returns>
        IPersistenceConfigurer IDatabaseConfiguration.Create(Assembly assembly)
        {
            SQLiteConfiguration config = new SQLiteConfiguration()
                                            .UsingFile(m_strDbPath)
                                            .ProxyFactoryFactory("NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu")
                                            .ShowSql();

            if (!File.Exists(m_strDbPath))
            {
                PersistenceModel pm = new PersistenceModel();
                pm.AddMappingsFromAssembly(assembly);

                SessionSource ss = new SessionSource(config.ToProperties(), pm);
                ss.BuildSchema();
                ss = null;
            }

            return config;
        }
Esempio n. 13
0
 private static void BuildSchema(FluentConfiguration configuration)
 {
     var sessionSource = new SessionSource(configuration);
     var session = sessionSource.CreateSession();
     sessionSource.BuildSchema(session);
 }
Esempio n. 14
0
 public void Create()
 {
     ISessionSource s = new SessionSource(new SQLRPersistenceModel());
     s.BuildSchema();
 }