Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Rasec on November 08, 2008, 05:43:33 am
-
Hello,
I'd like to know how can i declare two attributes unique in my Logical Model class to generate an unique compound constraint in the database? I know how to set unique in Tagged values, but i don't know how can i set two attributes to be compound when i generate the script for database.
Any idea? I really need help with this because i can't find any reference about how to do.
An example of what i need is:
Suppose i have a SECTOR table with column CODE and ID_DEPARTMENT. Made them unique and compound i will never have any equal data in CODE and ID_DEPARTMENT when search together.
I hope I have managed to explain my problem. ;)
Thanks
Rasec
-
Set up an index (perhaps the documentation files this under "key" so check both). When you set up the columns and such you will also be able to add a unique constraint. [I don't have EA on this machine, and I cannot remember exactly.]
It might be that you need to add this as a constraint instead. It's there in the EA help, you just need to look for it.
This is one of those things that is easier when you get the hang of how EA does things with databases. Of course when you've gotten the hang of it you've probably already got all the answers...
HTH, David
PS: If you really cannot find it post back. One of us will have been working in this area - or I'll be working on my EA box - and you will get an answer. But in the meantime see if the above doesn't get you unstuck.
-
Set up an index (perhaps the documentation files this under "key" so check both). When you set up the columns and such you will also be able to add a unique constraint. [I don't have EA on this machine, and I cannot remember exactly.]
It might be that you need to add this as a constraint instead. It's there in the EA help, you just need to look for it.
This is one of those things that is easier when you get the hang of how EA does things with databases. Of course when you've gotten the hang of it you've probably already got all the answers...
HTH, David
PS: If you really cannot find it post back. One of us will have been working in this area - or I'll be working on my EA box - and you will get an answer. But in the meantime see if the above doesn't get you unstuck.
Thanks David,
I will try this right now.
If doesn't work i will post again to see if there other solutions.
Thanks a lot again.
-
PS: If you really cannot find it post back. One of us will have been working in this area - or I'll be working on my EA box - and you will get an answer. But in the meantime see if the above doesn't get you unstuck.
Hello «Midnight».
I tried this in my Logical Diagram, but i think this solution doesn't fit with Logical Model. I tried to create this index, but i can't associate with a column and set unique constraint.
There is a solution for my Logical Diagram problem?
I mean, how could create a unique compound attributes to generate my code and database with this type of constraint.
Thanks!
-
To set a unique "compound" (composite) constraint...
- Select the table and add an operation [F10] with stereotype <unique> and Save.
- Select the <unique> operation in the Operations list, select the Columns to add the columns.
Use the same steps for a composite index.
To set the index as unique, select the <index> operation in the Operations list, click on [Extended Properties...], and check the
-
To set a unique "compound" (composite) constraint...
- Select the table and add an operation [F10] with stereotype <unique> and Save.
- Select the <unique> operation in the Operations list, select the Columns to add the columns.
Use the same steps for a composite index.
To set the index as unique, select the <index> operation in the Operations list, click on [Extended Properties...], and check the
I got it. In my Database Model i can do that and works!
But i need to do this in my Class Model. In Operation window i don't have how to specify the column either an attribute. So, i i need to specify an Unique Compoud Constraint in my Class Model to generate the database script with this constraint, how can i proceed? I don't know what i need to configure.
Thanks!!
-
Any idea how can i create unique compound constraints in my Class Model? I have one class that's have others declarated objects. I need to create a unique compound constraints for this objects.
But i need to do this only in my Class Model. All the others models it's ok.
Thanks!