Page 1 of 1

Oracle UDT with UDT attribute support?

Posted: Tue 03 May 2011 23:36
by awk
Does LinqConnect support oracle UDTs which contain UDT attributes, for example something like this?

Code: Select all

CREATE TYPE Customer_objtyp AS OBJECT (
    CustNo NUMBER,
    CustName VARCHAR2(200),
    Address_obj ADDRESS_OBJTYP
) NOT FINAL;
I have run the LinqConnect Model wizard against a table of the above objects but when I query the table I get the following exception:

Code: Select all

System.InvalidOperationException Invalid datatype: ADDRESS_OBJTYP
The generated code looks like this:

Code: Select all

[Column(Name = @"ADDRESS_OBJ", Storage = "_ADDRESSOBJ", DbType = "ADDRESS_OBJTYP NULL")]
public object ADDRESSOBJ
{
    get
    {
        return this._ADDRESSOBJ;
    }
    set
    {
        if (this._ADDRESSOBJ != value)
        {
            this.OnADDRESSOBJChanging(value);
            this.SendPropertyChanging();
            this._ADDRESSOBJ = value;
            this.SendPropertyChanged("ADDRESSOBJ");
            this.OnADDRESSOBJChanged();
        }
    }
}
Thanks in advance.

Posted: Wed 04 May 2011 14:07
by StanislavK
Thank you for your report, we will consider showing an error during model validation in such situations.

LinqConnect does not support user-defined types. It is possible to work with an object table only because such table can be accessed as a 'usual' one that has the columns of the same types as the corresponding UDT fields. If this table has a column (i.e., a UDT has a field) of unsupported data type (e.g., another UDT), LinqConnect cannot work with it.

To work with object types, you can use the OracleObject class or the classes generated by the Oracle Object wizard instead:
http://www.devart.com/dotconnect/oracle ... jects.html

Posted: Thu 05 May 2011 00:09
by awk
StanislavK wrote:It is possible to work with an object table only because such table can be accessed as a 'usual' one that has the columns of the same types as the corresponding UDT fields.
Thanks for the explanation. That's what I thought was happening and the official Oracle entity framework beta behaves in much the same way.