Oracle UDT with UDT attribute support?

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
awk
Posts: 2
Joined: Tue 03 May 2011 23:20

Oracle UDT with UDT attribute support?

Post by awk » Tue 03 May 2011 23:36

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.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 04 May 2011 14:07

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

awk
Posts: 2
Joined: Tue 03 May 2011 23:20

Post by awk » Thu 05 May 2011 00:09

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.

Post Reply