Indexes and reverse mapping

6 posts, 0 answers
  1. Henk
    Henk avatar
    113 posts
    Member since:
    Apr 2006

    Posted 02 Nov 2009 Link to this post

    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?
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 02 Nov 2009 Link to this post

    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.
  3. DevCraft banner
  4. Henk
    Henk avatar
    113 posts
    Member since:
    Apr 2006

    Posted 03 Nov 2009 Link to this post

    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.
  5. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 04 Nov 2009 Link to this post

    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.
  6. Henk
    Henk avatar
    113 posts
    Member since:
    Apr 2006

    Posted 05 Nov 2009 Link to this post

    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?

  7. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 06 Nov 2009 Link to this post

    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.
Back to Top
DevCraft banner