Reverse Mapping - stop removing plural "s"

8 posts, 0 answers
  1. Timothy Fischer
    Timothy Fischer avatar
    10 posts
    Member since:
    Mar 2009

    Posted 27 Jul 2009 Link to this post

    Hi,
    Is there a config option to have the reverse mapping stop removing the "s" off our tables?  having class names of "Basi" instead of Basis, and a hundred other classes is virtually unusable.  And whenever we regen the stuff - it never remembers our fixes from workstation to workstation, etc.

    Please help!
    Thanks,

    Tim
  2. Ady
    Admin
    Ady avatar
    589 posts

    Posted 28 Jul 2009 Link to this post

    Hi Tim,

     Currently there is no option to switch this behavior off, but we have implemented an improved name generation mechanism that would handle 'singular to plural' naming more intelligently.
    This implementation should be available in the near future in one of our service packs.

     Whenever you make changes to the default name , ex: Basi to Basis, this change is saved in the Reversemapping.config file. If this file is not present in the project, the schema is read from the database and default settings are applied.

    Kind regards,
    Ady
    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. Robert
    Robert avatar
    6 posts
    Member since:
    Sep 2008

    Posted 01 Sep 2009 Link to this post

    Hello All,

    We have several hundred data classes which we maintain by reverse engineering the database. Changing naming conventions breaks our ability to maintain the syncronisation between the database and data classes in an automated way.

    Given the complexity of the English language I have my doubts as about how accurate this process can be.

    Non-english table names will also cause problems for the users.

    There also seems to be problems with capital letters in table names for example ABC_table creates the A_B_C_table class where as abc_table maps to abctable.

    For the above reasons I also  would like to see the option to suppress renaming.

    Thanks,

    Robert.
  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 03 Sep 2009 Link to this post

    Hi Robert,

    Currently there is no other way to avoid this except to manually rename your classes. We have implemented an improved naming mechanism that proves to be really accurate. However with the new mechanism you will have the option to specify some rules using just play XML. You will be able to specify rules for other languages as well. This mechanism should be in place with one of our future service packs.

    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. Oleg
    Oleg avatar
    8 posts
    Member since:
    Sep 2009

    Posted 10 Sep 2009 Link to this post

    Hi,
    When will we get service pack with "improved naming mechanism"?

    Thanks,
    Oleg
  7. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 11 Sep 2009 Link to this post

    Hi Oleg Voinov,

    The naming mechanism is to be integrated into the product. I cannot give you an exact time frame in which the service pack will be released but I will notify you once this happens. We are sorry for any inconvenience caused.

    Kind regards,
    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.
  8. Robert Gibbins
    Robert Gibbins avatar
    6 posts
    Member since:
    Sep 2009

    Posted 11 Sep 2009 Link to this post

    Hello Petar,

    Would it be possible for this naming mechanism to write some form of xml naming file such that:

    1. If no entry exists in the file for a class or field, one is written using the current naming convention.

    2. If a name for a class or field exists in the xml file, that name is used instead.

    This would have several advantages. Firstly changes to the naming algorithm would no longer change the object model when reverse engineering and secondly any problems with naming could be 'fixed' by updating the mapping file.

    Kind Regards,

    Robert.
  9. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 11 Sep 2009 Link to this post

    Hello Robert Gibbins,

    1. Initially all XML entries will have to be written on hand by the user. You can, of course, implement some logic to be executed after reverse map that will traverse all your generated classes and add the "fixes" you have made to the XML file.
    2. That would be the purpose of the XML file. The mechanism would have some basic rules implemented in itself but whenever there is an entry in the XML file that "conflicts" with the mechanism than the entry is respected. For example:
    You have a table Orders. The default naming mechanism would try to rename it to Order. Now if you have an xml entry that says that each time the word Orders is met it should be reverse mapped to Ord (this is just an example) then the wizard would reverse map it to Ord (as specified in the XML file).

    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