Mapping Views and Decimal type

9 posts, 1 answers
  1. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 22 Aug 2009 Link to this post

    Hi,

    I am using Open Access (2009.2.720.1)  - I have updated to see if my issue has been fixed.

    You have provided reverse mapping of views - which is great, many thanks, but I am having a problem. One of my views returns a few fields (columns) of SQL type "money" which usually maps to system type decimal. However in the reverse mapping wizard (and subsequently in the generated code), these fields are set to type "bool?", and further, I can't change the type since the only two options offered are "bool" and "bool?" - also blank, but that gets ignored.

    I can of course over ride this in the generated class code, but that involves changing the generated file and thus it will get overwritten if I need to regenerate.

    Is this me, or a problem and if so is there a better workaround.

  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 24 Aug 2009 Link to this post

    Hello Andrew,

    This seems to be a local problem caused by your configuration. We actively tested your scenario and everything worked out fine for us. Can you please check if you have any additional type mappings in your back-end configuration(app.config file). Those configuration may look something like this:
    <typeMap> 
              <typeMapping> 
                <CLRType>System.Boolean</CLRType> 
                <SQLType>money</SQLType> 
              </typeMapping> 
            </typeMap> 


    Best wishes,
    Petar
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 31 Aug 2009 Link to this post

    Hi,

    Thanks for the repsonse. I don't have any type mappings - certianly none that I have created myself. I didi a search in my project for anything similar and nothing found.

    I did wonder whether this might be in a template file, but i am unsure about where to look.

    Also note this only seems to happen on a view being reverse mapped, tables seem fine.

    Andrew
  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 31 Aug 2009 Link to this post

    Hi Andrew,

    That is really strange. The template files should not be the case as the same ones are used for generating classes from views and tables. So if your tables are correct, the views should be correct as well. Are you sure that the view is defined in the way you expect? Maybe there is an error on the SQL server? If not, can you please open a support ticket and provide us with any available information (like database or project) so we will be able to reproduce and dig into the problem deeper.

    Sincerely yours,
    Petar
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 31 Aug 2009 Link to this post

    OK, I am a bit confused now, but I can point you towards where the problem lies..

    I decided to "try again", so I created a copy of my view in the database, re-ran the reverse mapping wizard, and it mapped the money columns correctly to decimals.I indicated my primary key and clicked the "Generate and Save Config".

    Then, I re-ran the reverse mapping wizard again. Immediately going to the Advanced View field definition, the "Type" field on the wizard now shows a blank value and the only options in the drop down are bool and bool?

  7. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 31 Aug 2009 Link to this post

    Thanks for the response, I was writing my post at the same time.

    I now note that this is happening with tables too (the blank "Type" on second viewing in the wizard). I presume I must have actually selected the bool option at some point which then actually changes the mappings.

    Andrew
  8. Answer
    PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 01 Sep 2009 Link to this post

    Hi Andrew,

    This seems to be a visual glitch with the combo box. If you select it as blank and click generate you should still be getting the fields recognized as decimal. Please find your Telerik points updated for bringing this issue to our attention.

    Greetings,
    Petar
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Caroline Jaensch
    Caroline Jaensch avatar
    3 posts
    Member since:
    Feb 2009

    Posted 15 Oct 2009 Link to this post

    I have the same problem - but your suggested fix is not working for me.   I also have a problem where field of the Date datatype in SQL Server 2008 are incorrectly mapped to a string.   Can you advise when these problems will be fixed?

    Regards,

    David
  10. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 16 Oct 2009 Link to this post

    Hello Caroline Jaensch,

    The false behavior when trying to resolve the decimal types again in the reverse mapping wizard is fixed with the latest internal build. If you download and install it you should not be experiencing such problems anymore.
    Unfortunately, I am not able to provide you with an exact time frame when the SQL Server 2008 types will be supported by Telerik OpenAccess ORM. They are on our TODO list though.

    All the best,
    Petar
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
DevCraft banner