コード例 #1
0
        public static string GetDialect(bool isSpatial, ArchAngel.Providers.EntityModel.Controller.DatabaseLayer.DatabaseTypes databaseType)
        {
            switch (databaseType)
            {
            case DatabaseTypes.MySQL:
                return(isSpatial ? "NHibernate.Spatial.Dialect.MySQLSpatialDialect,NHibernate.Spatial.MySQL" : "NHibernate.Dialect.MySQLDialect");

            case DatabaseTypes.SQLCE:
                return(isSpatial ? "NHibernate.Dialect.MsSqlCeDialect" : "NHibernate.Dialect.MsSqlCeDialect");

            case DatabaseTypes.SQLServer2005:
                return(isSpatial ? "NHibernate.Spatial.Dialect.MsSql2008SpatialDialect,NHibernate.Spatial.MsSql2008" : "NHibernate.Dialect.MsSql2005Dialect");

            case DatabaseTypes.SQLServerExpress:
                return(isSpatial ? "NHibernate.Dialect.MsSql2005Dialect" : "NHibernate.Dialect.MsSql2005Dialect");

            case DatabaseTypes.Oracle:
                return(isSpatial ? "NHibernate.Dialect.Oracle9Dialect" : "NHibernate.Dialect.Oracle9Dialect");

            case DatabaseTypes.PostgreSQL:
                return("NHibernate.Dialect.PostgreSQLDialect");

            case DatabaseTypes.Firebird:
                return("NHibernate.Dialect.FirebirdDialect");

            case DatabaseTypes.SQLite:
                return("NHibernate.Dialect.SQLiteDialect");

            case DatabaseTypes.Unknown:
                return("unknown");

            default:
                throw new NotImplementedException("Dialect not handled yet: " + databaseType.ToString());
            }
        }
コード例 #2
0
        public static string GetDriver(ArchAngel.Providers.EntityModel.Controller.DatabaseLayer.DatabaseTypes databaseType)
        {
            switch (databaseType)
            {
            case DatabaseTypes.MySQL:
                return("NHibernate.Driver.MySqlDataDriver");

                break;

            case DatabaseTypes.SQLCE:
                return("NHibernate.Driver.SqlServerCeDriver");

                break;

            case DatabaseTypes.SQLServer2005:
            case DatabaseTypes.SQLServerExpress:
                return("NHibernate.Driver.SqlClientDriver");

                break;

            case DatabaseTypes.Oracle:
                return("NHibernate.Driver.OracleDataClientDriver");

                break;

            case DatabaseTypes.PostgreSQL:
                return("NHibernate.Driver.NpgsqlDriver");

            case DatabaseTypes.Firebird:
                return("NHibernate.Driver.FirebirdClientDriver");

            case DatabaseTypes.SQLite:
                return("NHibernate.Driver.SQLite20Driver");

            case DatabaseTypes.Unknown:
                return("unknown");

            default:
                throw new NotImplementedException("Driver not handled yet: " + databaseType.ToString());
            }
        }