This is a migrated thread and some comments may be shown as answers.

Mapping Views and Decimal type

8 Answers 111 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew
Top achievements
Rank 1
Andrew asked on 22 Aug 2009, 07:27 PM
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.

8 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 24 Aug 2009, 03:03 PM
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.
0
Andrew
Top achievements
Rank 1
answered on 31 Aug 2009, 02:02 PM
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
0
PetarP
Telerik team
answered on 31 Aug 2009, 03:22 PM
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.
0
Andrew
Top achievements
Rank 1
answered on 31 Aug 2009, 03:34 PM
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?

0
Andrew
Top achievements
Rank 1
answered on 31 Aug 2009, 04:30 PM
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
0
Accepted
PetarP
Telerik team
answered on 01 Sep 2009, 05:09 AM
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.
0
Caroline Jaensch
Top achievements
Rank 1
answered on 15 Oct 2009, 06:48 AM
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
0
PetarP
Telerik team
answered on 16 Oct 2009, 09:44 AM
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.
Tags
Databases and Data Types
Asked by
Andrew
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Andrew
Top achievements
Rank 1
Caroline Jaensch
Top achievements
Rank 1
Share this question
or