public override ReadOnlyCollection <PrimitiveType> GetStoreTypes()
 {
     if (EFProviderSettings.s_tracingEnabled)
     {
         EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (ENTRY) EFOracleProviderManifest::GetStoreTypes()\n");
     }
     if (this._primitiveTypes == null && EFOracleVersionUtils.IsVersionX(this._version))
     {
         if (this._version < EFOracleVersion.Oracle10gR1)
         {
             List <PrimitiveType> primitiveTypeList = new List <PrimitiveType>((IEnumerable <PrimitiveType>)base.GetStoreTypes());
             primitiveTypeList.RemoveAll((Predicate <PrimitiveType>)(primitiveType =>
             {
                 string lowerInvariant = primitiveType.Name.ToLowerInvariant();
                 if (!lowerInvariant.Equals("binary_float", StringComparison.Ordinal))
                 {
                     return(lowerInvariant.Equals("binary_double", StringComparison.Ordinal));
                 }
                 return(true);
             }));
             this._primitiveTypes = primitiveTypeList.AsReadOnly();
         }
         else
         {
             this._primitiveTypes = base.GetStoreTypes();
         }
     }
     if (EFProviderSettings.s_tracingEnabled)
     {
         EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (EXIT)  EFOracleProviderManifest::GetStoreTypes()\n");
     }
     return(this._primitiveTypes);
 }
 private XmlReader GetStoreSchemaDescription(string informationType)
 {
     if (EFOracleVersionUtils.IsVersionX(this._version))
     {
         return(EFOracleProviderManifest.GetOMDPStoreSchemaDescription(informationType));
     }
     return((XmlReader)null);
 }
 private static XmlReader GetProviderManifest()
 {
     if (EFOracleVersionUtils.GetStorageVersion(EFOracleProviderServices.versionHint_static) >= EFOracleVersion.Oracle12cR1)
     {
         return(EFOracleProviderManifest.GetXmlResource("Oracle.ManagedDataAccess.EntityFramework.Resources.EFOracleProviderManifest_12c_or_later.xml"));
     }
     return(EFOracleProviderManifest.GetXmlResource("Oracle.ManagedDataAccess.EntityFramework.Resources.EFOracleProviderManifest.xml"));
 }
        public EFOracleProviderManifest(string manifestToken)
            : base(EFOracleProviderManifest.GetProviderManifest())
        {
            if (EFProviderSettings.s_tracingEnabled)
            {
                EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (ENTRY) EFOracleProviderManifest::EFOracleProviderManifest()\n");
            }
            this._version = EFOracleVersionUtils.GetStorageVersion(manifestToken);
            this._token   = manifestToken;
            ODTSettings.FireEdmInUseEvent();
            EFOracleProviderManifest.m_bMapNumberToBoolean = false;
            int maxPrecision1;

            if ((maxPrecision1 = EFProviderSettings.Instance.GetMaxPrecision("BOOL", true)) > 0)
            {
                EFOracleProviderManifest.m_edmMappingMaxBOOL   = maxPrecision1;
                EFOracleProviderManifest.m_bMapNumberToBoolean = true;
            }
            else
            {
                EFOracleProviderManifest.m_edmMappingMaxBOOL = 1;
            }
            EFOracleProviderManifest.m_bMapNumberToByte = false;
            int maxPrecision2;

            if ((maxPrecision2 = EFProviderSettings.Instance.GetMaxPrecision("BYTE", true)) > 0)
            {
                EFOracleProviderManifest.m_edmMappingMaxBYTE = maxPrecision2;
                EFOracleProviderManifest.m_bMapNumberToByte  = true;
            }
            else
            {
                EFOracleProviderManifest.m_edmMappingMaxBYTE = 3;
            }
            int maxPrecision3;

            EFOracleProviderManifest.m_edmMappingMaxINT16 = (maxPrecision3 = EFProviderSettings.Instance.GetMaxPrecision("INT16", true)) <= 0 ? 5 : maxPrecision3;
            int maxPrecision4;

            EFOracleProviderManifest.m_edmMappingMaxINT32 = (maxPrecision4 = EFProviderSettings.Instance.GetMaxPrecision("INT32", true)) <= 0 ? 10 : maxPrecision4;
            int maxPrecision5;

            EFOracleProviderManifest.m_edmMappingMaxINT64 = (maxPrecision5 = EFProviderSettings.Instance.GetMaxPrecision("INT64", true)) <= 0 ? 19 : maxPrecision5;
            if (!EFProviderSettings.s_tracingEnabled)
            {
                return;
            }
            EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (EXIT)  EFOracleProviderManifest::EFOracleProviderManifest()\n");
        }
 public override ReadOnlyCollection <EdmFunction> GetStoreFunctions()
 {
     if (EFProviderSettings.s_tracingEnabled)
     {
         EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (ENTRY) EFOracleProviderManifest::GetStoreFunctions()\n");
     }
     if (this._functions == null && EFOracleVersionUtils.IsVersionX(this._version))
     {
         this._functions = base.GetStoreFunctions();
     }
     if (EFProviderSettings.s_tracingEnabled)
     {
         EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (EXIT) EFOracleProviderManifest::GetStoreFunctions()\n");
     }
     return(this._functions);
 }
        private void AppendType(EdmProperty column, string providerManifestToken)
        {
            TypeUsage typeUsage = column.TypeUsage;
            bool      flag      = false;
            Facet     facet;

            if (typeUsage.EdmType.Name == "binary" && 8 == typeUsage.GetMaxLength() && (column.TypeUsage.Facets.TryGetValue("StoreGeneratedPattern", false, out facet) && facet.Value != null) && StoreGeneratedPattern.Computed == (StoreGeneratedPattern)facet.Value)
            {
                flag = true;
                this.AppendIdentifier("rowversion");
            }
            else
            {
                string name = typeUsage.EdmType.Name;
                if (name.ToLowerInvariant() == "guid")
                {
                    this.AppendSql("raw(16)");
                }
                else if (name.ToLowerInvariant() == "pl/sql boolean")
                {
                    this.AppendSql("number(1, 0)");
                }
                else
                {
                    this.AppendSql(name);
                }
                switch (typeUsage.EdmType.Name)
                {
                case "number":
                    this.AppendSqlInvariantFormat("({0}, {1})", (object)typeUsage.GetPrecision(), (object)typeUsage.GetScale());
                    break;

                case "float":
                    this.AppendSqlInvariantFormat("({0})", (object)typeUsage.GetPrecision());
                    break;

                case "char":
                case "nchar":
                case "varchar2":
                case "nvarchar2":
                case "raw":
                    this.AppendSqlInvariantFormat("({0})", (object)typeUsage.GetMaxLength());
                    break;
                }
            }
            if (!flag && column.TypeUsage.Facets.TryGetValue("StoreGeneratedPattern", false, out facet) && facet.Value != null)
            {
                switch ((StoreGeneratedPattern)facet.Value)
                {
                case StoreGeneratedPattern.Identity:
                    if (EFOracleVersionUtils.GetStorageVersion(providerManifestToken) >= EFOracleVersion.Oracle12cR1)
                    {
                        this.AppendSql(" generated by default as identity");
                        break;
                    }
                    EFOracleDdlBuilder.m_bCreateSequenceAndTrigger = true;
                    break;

                case StoreGeneratedPattern.Computed:
                    EFOracleDdlBuilder.m_bCreateSequenceAndTrigger      = true;
                    EFOracleDdlBuilder.m_bStoreGeneratedPatternComputed = true;
                    break;
                }
            }
            this.AppendSql(column.Nullable ? " null" : " not null");
        }