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

Indexes and reverse mapping

5 Answers 76 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.
Henk
Top achievements
Rank 1
Henk asked on 02 Nov 2009, 01:02 PM
Hello,

I have used the reverse mapping wizard on my database and decided not to generate classes for a number of tables. On the tables that will not be used in the model are indexes in the database.  OA still tries to define the indexes in the model and I receive an error because it still references the classes that will not be generated.
Is it possible to ignore the indexes in the reverse mapping wizard for tables for which a class is not generated?

5 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 02 Nov 2009, 09:14 PM
Hi Henk Boen,

To achieve this goal you should remove the references to the non-generated classes inside the Reverse Mapping Wizard.  In order to do this you should the following steps:

1.    Run the Reverse Mapping Wizard
2.    Locate the reference node field inside the class and click on it
3.    Click on the Remove button on the right of the wizard

I think that should help you.

Greetings,
Damyan Bogoev
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
Henk
Top achievements
Rank 1
answered on 03 Nov 2009, 08:56 AM
Sorry but that's not the case.
It's not a field in a class referencing another class.
It's for instance a unique index on a column of a table that exists in the database but I do not want a class for that table generated.
I think the index on that table should be ignored during reverse mapping.
0
Damyan Bogoev
Telerik team
answered on 04 Nov 2009, 03:15 PM
Hello Henk Boen,

Sorry for the misunderstanding. Now the problem is clear but we were not able to represent it. Could you please provide us with with the steps you performed to get the error? Additionally, when exactly do you get the error - before generating the classes or during runtime? It is possible that you generated the unnecessary classes and then deleted them? Any additional information would be greatly appreciated.

Sincerely yours,
Damyan Bogoev
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
Henk
Top achievements
Rank 1
answered on 05 Nov 2009, 10:35 AM
Hello Damyan,

I have tried to reproduce the problem.
I received the error runtime.
What I did was I generated classes for 3 tables with the reverse mapping wizard.
If I do not change anything it's ok.
After that I decided to remove one table from the model.
I ran the reverse mapping wizard again. I deselected the generate column from the table to remove.
I also removed de reference node field from another table that is referencing the table to remove.
In the reverse mapping wizard there is now no reference to the table to remove.
I saved and regenerated the classes. I also removed the old class files for the table I removed from the model.
The model builds ok but if I try to use it I receive an error that the class is missing for the table I removed.
I cannot see the removed table in the forward or reverse wizard but still the information about the removed table and indexes is in the app.config file. Shouldn't that information be automatically removed from the app.config?

0
Damyan Bogoev
Telerik team
answered on 06 Nov 2009, 09:36 AM
Hi Henk Boen,

When you disable the Generate option for a class this does not remove the class from the model, just does not (re)generate the class when you click on the "Generate & Save Config" button. To exclude the class from the model and remove the metadata from the App.config file you should select the Ignore option from the combobox in the MapsTo column. In this case it is not necessary to uncheck the Generate option or delete the class manually.
Hope that helps.

Sincerely yours,
Damyan Bogoev
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
Henk
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Henk
Top achievements
Rank 1
Share this question
or