OracleCustomTypeMappingAttribute Class

The OracleCustomTypeMappingAttribute class is used to mark a custom type factory class or struct with information that is used by ODP.NET when a custom type is used to represent an Oracle UDT.

Class Inheritance





// C#
   AllowMultiple=false, Inherited=true)]
public sealed class OracleCustomTypeMappingAttribute : Attribute


Provider ODP.NET, Unmanaged Driver





.NET Framework

3.5, 4.5, 4.6, 4.7, 4.8


The OracleCustomTypeMapping attribute must be specified on the custom type factory class to indicate the Oracle UDT that the corresponding custom type represents. The Oracle UDT may be specified in the form schema_name.type_name.

For each Oracle UDT that the application uses, there must be a unique custom type factory, as follows:

  • Oracle Object Types

    The custom type factory must return a custom type that cannot be used to represent any other Oracle Object Type.

  • Oracle Collection Types

    The custom type factory may return a custom type that can be used by other Oracle Collection Types. This is common when an array type is used to represent an Oracle Collection, that is, when an int[] is used to represent a collection of NUMBERs.

If the OracleCustomTypeMappingAttribute is not specified, then custom type mappings must be specified through an XML configuration file, for example, app.config for Windows applications or the web.config for web applications, and the machine.config

Thread Safety