sdo_geometry support

7 posts, 0 answers
  1. Kineas
    Kineas avatar
    11 posts
    Member since:
    Apr 2011

    Posted 20 Jul 2011 Link to this post

    Hello,

    I tried to add a domain model for some table and I got this error when trying to map a creation procedure. 
    ---------------------------
    Metadata exception
    ---------------------------
    The metadata for field '_gEOMETRY' of class 'OracleService.V_JUDETE' cannot be initialized: Type converter initialization failed. The converter with name 'Telerik.OpenAccess.RT.Adonet2Generic.OracleUdt2StringConverter, Telerik.OpenAccess.Adonet2, Version=2011.1.411.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342' does not convert from CLR type 'System.Object' to SQL type 'SDO_GEOMETRY'.


    Parameter name: converterName


    Actual value was Telerik.OpenAccess.RT.Adonet2Generic.OracleUdt2StringConverter, Telerik.OpenAccess.Adonet2, Version=2011.1.411.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342.
    ---------------------------
    OK   
    ---------------------------

    So does OpenAccess support oracle sdo_geometry? 

    Best regards

  2. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 22 Jul 2011 Link to this post

    Hi Kineas,

    Yes, Telerik OpenAccess ORM supports Oracle sdo_geometry types. Unfortunately, the manual setup process is a bit more complex for Oracle, as the CLR type that represents such a column is user-written and can use any name and assembly; MSSQL has a fixed type for that. You have to implement custom type converters in order to prepare the CLR types out of the query results.


    I have attached a sample project that implements the CLR(i.e. SdoGeometry) types to represent the SDO_GEOMETRY / SDO_POINT_TYPE columns. The converters are implemented as well.

    Please have a look at the example and get back to us in case you have further questions.

    Kind regards,
    Ralph
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. Clyde Blaisdell
    Clyde Blaisdell avatar
    3 posts
    Member since:
    Feb 2010

    Posted 05 Mar 2014 in reply to Ralph Waldenmaier Link to this post

    Ralph,

       I am using Telerik Version 2013.3.1211.3.

       I looked at the example that you have listed and in the OracleCustomTypeConverter.cs file the comments say to add the section of xml code to the OpenAccess backend Configuration. Where and how is this done, do not see a specific file with that name and the .rlinq file is the only xml file related to the database objects.  I don't see a good location in the rlinq file for the code.

    Btw, I am using the Domain Model

    Thank you
  5. Ady
    Admin
    Ady avatar
    588 posts

    Posted 07 Mar 2014 Link to this post

    Hi Clyde,

     The comment block in the OracleCustomTypeConverter.cs does not apply to the mapping (FluentMapping) used in the example. If you look at the 'PrepareMapping ' method of the  'Setup' class in the Model.cs, you will see that the Fluent API is used to specify this converter for the SdoGeometry field.

    Does the example not work for you?

    Regards,
    Ady
    Telerik
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
  6. Clyde Blaisdell
    Clyde Blaisdell avatar
    3 posts
    Member since:
    Feb 2010

    Posted 07 Mar 2014 in reply to Ady Link to this post

    Ady,

       I am using the Domain Model rather than the Fluent, so the example doesn't exactly translate. Do you have a example using the Domain Model?

    Dana
  7. Clyde Blaisdell
    Clyde Blaisdell avatar
    3 posts
    Member since:
    Feb 2010

    Posted 07 Mar 2014 in reply to Ady Link to this post

    Ady,

        Couple more things, Fluent mapping API doesn't support Stored procedures.  Also, I need the ability to update the model from the database this is why the Domain Model was chosen.  If I customize the generated classes, then I will loose these changes every time I need to update the model from the database.
  8. Ady
    Admin
    Ady avatar
    588 posts

    Posted 11 Mar 2014 Link to this post

    Hello Clyde,

     Working with the Domain Model approach should not be any different. You can generate the model from the database and then you would need to select the property in the designer and change the data type of the generated field from 'object' to 'SdoGeometry'.
    You will also need to specify the converter name for this field. This should be the FullName of the type that implements the converter. For example - 'ExampleConverter.OracleCustomTypeConverter'
    This value can be set in the 'Model Schema Explorer'.

    Do get back in case you need further assistance.

    Regards,
    Ady
    Telerik
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top
DevCraft banner