Defining an index / constraint

9 posts, 0 answers
  1. Mikael Kleinwort
    Mikael Kleinwort avatar
    22 posts
    Member since:
    May 2004

    Posted 09 Jan 2012 Link to this post

    How do I define indexes / primary keys / constraints in the OA class designer? Somehow I seem to miss the obvious. I am defining my domain classes in the designer for the EntitiesModel.rlinq file.

    In OA classic, I recall, it was easy to add constraints and indexes in the designer. Now I somehow can't find my way.
    Input appreciated! Thank you.

    Regards, Mikael

  2. Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 10 Jan 2012 Link to this post

    Hi Mikael,

    In the new API and Visual Designer, indexes are created for all primary and foreign key columns. To set a column as a primary key, set the Identity of the corresponding property to True. In order to set a column as a foreign key, an association should exist with the corresponding property as a target or source. 

    There is no other mechanism allowing you direct control on the index creation. 

    Kindly let us know if you need any further information or assistance.

    Regards,
    Ivailo
    the Telerik team

    SP1 for Q3’11 of Telerik OpenAccess ORM is available for download

  3. DevCraft banner
  4. Mikael Kleinwort
    Mikael Kleinwort avatar
    22 posts
    Member since:
    May 2004

    Posted 10 Jan 2012 Link to this post

    Hello Ivailo,

    thank you for your answer.

    How do I define constraints? I need to define UNIQUE constraints for a sigle column, as well as, for a set of columns.I haven't found any comment on this in the ORM help file.

    Thank you for your input.

    Regards, Mikael
  5. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 11 Jan 2012 Link to this post

    Hello Mikael,

    Using Fluent Mapping you can define indexes on columns. See this article in the docs.

    Regards

    Henrik
  6. Mikael Kleinwort
    Mikael Kleinwort avatar
    22 posts
    Member since:
    May 2004

    Posted 13 Jan 2012 Link to this post

    Hello Henrik, tank you for your hint. I'll go this way.

    I like the fluet API approach anyway very much and it's time for me to get familiar with it anyway.

    Regards, Mikael

  7. Serge
    Admin
    Serge avatar
    375 posts

    Posted 13 Jan 2012 Link to this post

    Hello Mikael,

     It is possible that you create constraints in the DSL however as Henrik has suggested it is in fact the Fluent API that exposes most of Telerik OpenAccess's functionality (including indexes) so I am glad you are heading over that direction. 

    Do not hesitate to let us know if you face any problems using the Fluent Mapping API.

    Kind regards,
    Serge
    the Telerik team

    SP1 for Q3’11 of Telerik OpenAccess ORM is available for download

  8. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 13 Jan 2012 Link to this post

    Hello Mikael,

    I know it was not what you actually asked for (how to do it with the visual designer), but please mark the answer as the answer to your question, so that other visitors of the forum will find their answers easier.

    Have a nice weekend,

    Regards

    Henrik
  9. Mikael Kleinwort
    Mikael Kleinwort avatar
    22 posts
    Member since:
    May 2004

    Posted 13 Jan 2012 Link to this post

    Serge,

    I am dying to know and willing to embarrass myself... what do the abbreviations DSL and DSW stand for? I haven't found any refernece to this.

    Regards, Mikael
  10. Serge
    Admin
    Serge avatar
    375 posts

    Posted 13 Jan 2012 Link to this post

    Hello Mikael,

     Please don't feel embarrassed, I will make sure that content on both abbreviations is easily found on our documentation page. I am sorry for misleading you using the term DSL, what I was actually referring to is the visual designer. DSL stands for domain specific language, and it is partly what we did with our designer. We defined a language specific to the terms of an object relational mapper, and exposed a visual designer that you can use to operate with it, which we sometimes refer as simply DSL. 

    DSW on the other hand, stands for the Domain Services Wizard, which is a wizard that comes with OpenAccess and can automate the generation of WCF services based the model that you have defined. 

    Again I would like to apologize for misleading you, I hope this clears the picture for you. 

    All the best,
    Serge
    the Telerik team

    SP1 for Q3’11 of Telerik OpenAccess ORM is available for download

Back to Top
DevCraft banner