Re: [Fornax-developer] Unique field
I reverted the hint in DomainObject.xpt::columnAnnotations. It will not work when there are several fields marked as unique. When several fields the entity level annotation must be used, DEFINE uniqueConstraints FOR DomainObject If we should do this we should do it as I described, i.e. in dsl, meta model etc. Pavel, will you do that, or do you need assistance? /Patrik Patrik Nordwall wrote: > > I think that is too complicated. I think it is enough with _one_ unique > set of attributes/references for an entity. In cases when more is added > that can be handled by hand written db constraints and jpa annotations, > and sometimes SpecialCases.xpt. Keep it simple. > /Patrik > > > PaloT wrote: >> >> 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 >> 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 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 >> >> > > -- View this message in context: http://old.nabble.com/Unique-field-tp28510970s17564p28572972.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
Re: [Fornax-developer] Unique field
I think that is too complicated. I think it is enough with _one_ unique set of attributes/references for an entity. In cases when more is added that can be handled by hand written db constraints and jpa annotations, and sometimes SpecialCases.xpt. Keep it simple. /Patrik PaloT wrote: > > 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 > 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 >>> 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 > > -- View this message in context: http://old.nabble.com/Unique-field-tp28510970s17564p28520432.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
Re: [Fornax-developer] Unique field
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 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 >> 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
Re: [Fornax-developer] Unique field
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 > 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
Re: [Fornax-developer] Unique field
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 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