oracle mdsys.vertex_set_type custom mapping c# -
i developing c# application works oracle database. using oracle.dataaccess provider. when try run query:
select sdo_util.getvertices(sdo_geom.sdo_intersection(geo1,geo2,0.005)) geotable1 sdo_anyinteract(geo1,geo2) = 'true' , id1 = 59
the id number example. result of query per oracle specification mdsys.vertex_set_type, consists of table of objects of vertex_type.
and first problem. when try run query oracle.dataaccess provider, error "custom type mapping 'datasource='...' schemaname='mdsys' typename='vertex_set_type'' not specified or invalid. have searched solution, should implement custom mapping, without success.
so tried implement me. code:
[oraclecustomtypemappingattribute("mdsys.vertex_set_type")] public class vertexsettype : oraclecustomtypebase<vertexsettype> { private enum oracleobjectcolumns { vertex_type } private list<vertextype> vertextype; [oracleobjectmappingattribute(0)] public list<vertextype> vertextype { { return vertextype; } set { vertextype = value; } } public override void mapfromcustomobject() { setvalue((int)oracleobjectcolumns.vertex_type, vertextype); } public override void maptocustomobject() { vertextype = getvalue<list<vertextype>>((int)oracleobjectcolumns.vertex_type); } }
the vertextype have defined as:
[oraclecustomtypemappingattribute("mdsys.vertex_type")] public class vertextype : oraclecustomtypebase<vertextype> { private enum oracleobjectcolumns { x, y, z, w, id } private decimal? x; [oracleobjectmappingattribute(0)] public decimal? x { { return x; } set { x = value; } } private decimal? y; [oracleobjectmappingattribute(0)] public decimal? y { { return y; } set { y = value; } } private decimal? z; [oracleobjectmappingattribute(0)] public decimal? z { { return z; } set { z = value; } } private decimal? w; [oracleobjectmappingattribute(0)] public decimal? w { { return w; } set { w = value; } } private decimal? id; [oracleobjectmappingattribute(0)] public decimal? id { { return id; } set { id = value; } } public override void mapfromcustomobject() { setvalue((int)oracleobjectcolumns.x, x); setvalue((int)oracleobjectcolumns.y, y); setvalue((int)oracleobjectcolumns.z, z); setvalue((int)oracleobjectcolumns.w, w); setvalue((int)oracleobjectcolumns.id, id); } public override void maptocustomobject() { x = getvalue<decimal?>((int)oracleobjectcolumns.x); y = getvalue<decimal?>((int)oracleobjectcolumns.y); z = getvalue<decimal?>((int)oracleobjectcolumns.z); w = getvalue<decimal?>((int)oracleobjectcolumns.w); id = getvalue<decimal?>((int)oracleobjectcolumns.id); } }
but when run query againg, error:
unable cast object of type 'spatial.vertexsettype' type 'oracle.dataaccess.types.ioraclearraytypefactory'.
i cannot move forward situation because of less c# custom mapping of oracle data types.. please, if should help, appreciate it. thanks.
never mind, have fixed me. mdsys.vertex_set_type should defined simple oracle array, containing vertextype objects.
[oraclecustomtypemappingattribute("mdsys.vertex_set_type")] public class vertexsettype : oraclearraytypefactorybase<vertextype> { }
Comments
Post a Comment