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

Defining an index / constraint

8 Answers 75 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.
Mikael Kleinwort
Top achievements
Rank 1
Mikael Kleinwort asked on 09 Jan 2012, 10:38 PM
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

8 Answers, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 10 Jan 2012, 08:50 AM
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

0
Mikael Kleinwort
Top achievements
Rank 1
answered on 10 Jan 2012, 09:39 PM
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
0
IT-Als
Top achievements
Rank 1
answered on 11 Jan 2012, 08:44 AM
Hello Mikael,

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

Regards

Henrik
0
Mikael Kleinwort
Top achievements
Rank 1
answered on 13 Jan 2012, 12:07 PM
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

0
Serge
Telerik team
answered on 13 Jan 2012, 12:44 PM
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

0
IT-Als
Top achievements
Rank 1
answered on 13 Jan 2012, 12:47 PM
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
0
Mikael Kleinwort
Top achievements
Rank 1
answered on 13 Jan 2012, 01:27 PM
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
0
Serge
Telerik team
answered on 13 Jan 2012, 01:37 PM
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

Tags
Design Time (Visual Designer & Tools)
Asked by
Mikael Kleinwort
Top achievements
Rank 1
Answers by
Ivailo
Telerik team
Mikael Kleinwort
Top achievements
Rank 1
IT-Als
Top achievements
Rank 1
Serge
Telerik team
Share this question
or