Good proposal. I'm just unsure about unique keys. More often we need
uniqueness on separate column than as composite key. Maybe we should
add name to unique and join them with this name like:
   String name key
   String group unique "key"
   Integer externalID unique
   String some1 unique "some"
   String some2 unique "some"

Will generate 3 unique indexes.
1) "key" above name and group attribute
2) "externalID" above externalID
3) "some" above some1 and some2

Is it too complex?

Pavel

On Mon, May 10, 2010 at 8:16 PM, Patrik Nordwall
<patrik.nordw...@gmail.com> wrote:
>
> Good!
>
> I think we can add unique as keyword in DSL. Then I would like to have this
> functionality:
>
> - in meta model we should also add unique (boolean) field on Attribute and
> Reference
> - in generation of unique annotations and in ddl we should look at above
> unique field in meta model, instead of looking at key
> - in transformation we should set above unique fields for
> attributes/references marked as key, but if unique has been defined we
> should use that instead, this means that it possible to define key and
> unique differently, and unique has highest prio
> - several attributes and references can be marked with unique, if more than
> one it is a composite unique constraint (similar to how we do with key
> currently)
> - unique constraint in ddl should also be generated
>
> Does that make sense?
>
> Please add ticket in jira also. Important for release notes.
>
> /Patrik
>
>
>
>
>
> PaloT wrote:
>>
>> DomainObject.xpt::columnAnnotations updated in SVN. Now you can use
>> hint="unique" on attribute to define attribute to be unique. Patrik
>> should we add this as another validation keyword or will we keep it as
>> hint?
>>
>> Pavel
>>
>>
>> On Mon, May 10, 2010 at 1:16 PM, Pavel Tavoda <pavel.tav...@gmail.com>
>> wrote:
>>> Hello,
>>> should I generate field which is unique? We have many constraint
>>> possibilities but I don't know how to make field unique. I can do it
>>> with 'key' but than attribute isn't changeable, this attribute is
>>> changeable and following doesn't work:
>>>   String name key changeable
>>>
>>> TNX
>>>
>>> Pavel
>>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Fornax-developer mailing list
>> Fornax-developer@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/Unique-field-tp28510970s17564p28512722.html
> Sent from the Fornax-Platform mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Fornax-developer mailing list
> Fornax-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>

------------------------------------------------------------------------------

_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to