Exemple #1
0
        public DefaultDatabaseEntityDefFactory(IDatabaseEngine databaseEngine, IDatabaseTypeConverterFactory typeConverterFactory)
        {
            _databaseSettings     = databaseEngine.DatabaseSettings;
            _databaseEngine       = databaseEngine;
            _typeConverterFactory = typeConverterFactory;

            IEnumerable <Type> allEntityTypes;
Exemple #2
0
        /// <summary>
        /// Initialize
        /// </summary>
        /// <param name="databaseEngine"></param>
        /// <exception cref="DatabaseException"></exception>
        public static void Initialize(IDatabaseEngine databaseEngine)
        {
            DatabaseCommonSettings databaseSettings = databaseEngine.DatabaseSettings;

            VarcharDefaultLength = databaseSettings.DefaultVarcharLength == 0 ? LengthConvention.DEFAULT_VARCHAR_LENGTH : databaseSettings.DefaultVarcharLength;

            IEnumerable <Type> allEntityTypes;

            if (databaseSettings.AssembliesIncludeEntity.IsNullOrEmpty())
            {
                allEntityTypes = ReflectUtil.GetAllTypeByCondition(entityTypeCondition);
            }
            else
            {
                allEntityTypes = ReflectUtil.GetAllTypeByCondition(databaseSettings.AssembliesIncludeEntity, entityTypeCondition);
            }

            IDictionary <string, EntitySetting> entitySchemaDict = ConstructeSchemaDict(databaseSettings, databaseEngine, allEntityTypes);

            WarmUp(allEntityTypes, databaseEngine.EngineType, entitySchemaDict);