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

System.Object

System.Attribute

System.OracleCustomTypeMappingAttribute

Declaration

// C#
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct,  
   AllowMultiple=false, Inherited=true)]
public sealed class OracleCustomTypeMappingAttribute : Attribute

Requirements

Provider ODP.NET, Unmanaged Driver
Assembly Oracle.DataAccess.dll
Namespace Oracle.DataAccess.Types
.NET Framework 3.5, 4.0, 4.5

Remarks

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

All public static methods are thread-safe, although instance methods do not guarantee thread safety.

OracleCustomTypeMappingAttribute Members

OracleCustomTypeMappingAttribute members are listed in the following tables.

OracleCustomTypeMappingAttribute Constructors

OracleCustomTypeMappingAttribute constructors are listed in Table 16-1.

Table 16-1 OracleCustomTypeMappingAttribute Constructors

Constructor Description

OracleCustomTypeMappingAttribute Constructors

Instantiates a new instance of OracleCustomTypeMappingAttribute class


OracleCustomTypeMappingAttribute Static Methods

OracleCustomTypeMappingAttribute static methods are listed in Table 16-2.

Table 16-2 OracleCustomTypeMappingAttribute Static Methods

Method Description

Equals

Inherited from System.Attribute

GetCustomAttribute

Inherited from System.Attribute

GetCustomAttributes

Inherited from System.Attribute

IsDefined

Inherited from System.Attribute

ReferenceEquals

Inherited from System.Attribute


OracleCustomTypeMappingAttribute Properties

OracleCustomTypeMappingAttribute properties are listed in Table 16-3.

Table 16-3 OracleCustomTypeMappingAttribute Properties

Property Description

UdtTypeName

Specifies the Oracle user-defined type name that the custom class maps to

TypeId

Inherited from System.Attribute


OracleCustomTypeMappingAttribute Methods

OracleCustomTypeMappingAttribute methods are listed in Table 16-4.

Table 16-4 OracleCustomTypeMappingAttribute Methods

Method Description

Equals

Inherited from System.Attribute

GetHashCode

Inherited from System.Attribute

GetType

Inherited from System.Attribute

IsDefaultAttribute

Inherited from System.Attribute

Match

Inherited from System.Attribute

ToString

Inherited from System.Attribute


OracleCustomTypeMappingAttribute Constructors

OracleCustomTypeMappingAttribute constructors create new instances of the OracleCustomTypeMappingAttribute class.

Overload List:

OracleCustomTypeMappingAttribute(string)

This constructor creates and initializes an OracleCustomTypeMappingAttribute using the specified Oracle user-defined type name.

Declaration

// C#
public OracleCustomTypeMappingAttribute(string udtTypeName)

Parameters

  • udtTypeName

    The Oracle user-defined type name that the custom class maps to.

Remarks

The udtTypeName parameter is case-sensitive. The udtTypeName is specified in the form of schema_name.type_name.

OracleCustomTypeMappingAttribute Static Methods

OracleCustomTypeMappingAttribute static methods are listed in Table 16-5.

Table 16-5 OracleCustomTypeMappingAttribute Static Methods

Method Description

Equals

Inherited from System.Attribute

GetCustomAttribute

Inherited from System.Attribute

GetCustomAttributes

Inherited from System.Attribute

IsDefined

Inherited from System.Attribute

ReferenceEquals

Inherited from System.Attribute


OracleCustomTypeMappingAttribute Properties

OracleCustomTypeMappingAttribute properties are listed in Table 16-6.

Table 16-6 OracleCustomTypeMappingAttribute Properties

Property Description

UdtTypeName

Specifies the Oracle user-defined type name that the custom class maps to

TypeId

Inherited from System.Attribute


UdtTypeName

This property specifies the Oracle user-defined type name that the custom class maps to.

Declaration

// C#
public string UdtTypeName {get; set;}

Property Value

A string that represents an Oracle user-defined type name.

Remarks

UdtTypeName is case-sensitive. It is specified in the form of schema_name.type_name.

OracleCustomTypeMappingAttribute Methods

OracleCustomTypeMappingAttribute methods are listed in Table 16-7.

Table 16-7 OracleCustomTypeMappingAttribute Methods

Method Description

Equals

Inherited from System.Attribute

GetHashCode

Inherited from System.Attribute

GetType

Inherited from System.Attribute

IsDefaultAttribute

Inherited from System.Attribute

Match

Inherited from System.Attribute

ToString

Inherited from System.Attribute