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

Is it possible to change the default behaviour of OpenAccess mapping?

1 Answer 60 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chau Cheng
Top achievements
Rank 1
Chau Cheng asked on 10 Dec 2009, 05:14 AM
What I am saying is, when doing forward mapping, I want :

1. System.String automatically map to NVARCHAR, 

2. The DB Table  Name and Column Name automatically use my Class Name and Property Name (not the private field name).


Going the mapping designer UI to tweak everything manually is a bit tedious for huge schema.

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 11 Dec 2009, 03:38 PM
Hello Chau Cheng,

 1. You can set the type mapping from the Backend configuration settings wizard. Navigate to Telerik -> OpenAccess -> Configuration->Backend configuration settings. At the bottom of the pop up window you will see a CLR Type Mapping setting. Click on the Collection and open the mapping screen. Set NVARCHAR for the SQL type of the System.String CLR type. Clicking ok will result in adding the following node to your app.config file:

<backendconfigurations>
      <backendconfiguration id="mssqlConfiguration" backend="mssql">
        <mappingname>mssqlMapping</mappingname>
        <logging.logEvents>none</logging.logEvents>
        <typeMap>
          <typeMapping>
            <CLRType>System.String</CLRType>
            <SQLType>nvarchar</SQLType>
          </typeMapping>
        </typeMap>
      </backendconfiguration>
    </backendconfigurations>

2. Unfortunately this is not yet possible with Telerik OpenAccess ORM. The only workaround would be to manually rename your column names. We are terribly sorry for any inconvenience this might have caused.


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
Design Time (Visual Designer & Tools)
Asked by
Chau Cheng
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or