Home » Modeling » UML2 » Re: Hibernate map does not have the required flag set
Re: Hibernate map does not have the required flag set [message #477241] |
Sat, 12 April 2008 13:58 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
I'm adding the UML2 newsgroup to the "to" list of the reply to ask if
it's true that UML's Ecore stereotype support doesn't support specifying
Ecore EAnnotations? I did notice that exporting an Ecore model
containing extended metadata annotations doesn't seem to preserve them,
even when I choose to "Process" the annotations. Lack of support for
EAnnotations seems very unfortunate. Ecore -> XSD -> Ecore preserves
annotations so it would be awfully nice if Ecore -> UML2 -> Ecore were
capable of that as well. Given that UML extends EModelElement I can
imagine it should be possible...
Yigal wrote:
> Martin,
> I agree with your final note that the system needs to be more flexible.
> I do not think we need to have double data files.
>
> Today, I have two files, one is the eCore file and another file is a
> smart utility I wrote that modifies the eCore file and adds the JPA
> annotations for length and validation.
> I'm using the IBM product RSA to design my application and it has
> limitation on setting the eCore. Each time we change the the design,
> we need to regenerate the eCore and lose all annotation (except
> documents).
> The RSA uses the internal eCore values of lower bound = 1 for required.
> I can had into my tool to had the nullability smart, but I would
> prefer it too be part of the eCore.
>
> thanks
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> The EntityName attribute has a column annotation which does not set
>> the nullable property (of the Column annotation). The main change
>> since september is that if there is a column annotation then the
>> nullability of the column annotation determines the nullability of
>> the column tag in the hibernate mapping.
>> The default value of nullable in ColumnImpl is true, so if nullable
>> is not set in the column annotation then the resulting column will be
>> nullable.
>> This could be improved so that the system checks if nullable is set
>> in the column annotation and if not, use the isrequired from the
>> eattribute.
>> I will change this in the coming days.
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> Martin
>>> I'm attaching a partial of my eCore. The Part is based on
>>> "EntityItem".
>>> Based on previous release of EMF 2.3.1, setting the lower bound to 1
>>> and upper bound to one indicates that the attribute is required.
>>> In this class the attributes "EntityName" and "name" are set that way.
>>> In the previous release of TENEO I would get a required field.
>>> However now I get no required.
>>>
>>> Yigal
>>>
>>> Martin Taal wrote:
>>>> Hi Yigal,
>>>> The logic for determining nullability of columns/properties has
>>>> changed in the latest build. One reason is this bugzilla:
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=225717
>>>>
>>>> A reason why even required properties get a nullable column is: in
>>>> case of single-table inheritance mapping all properties will get a
>>>> not-null=false because different objects (with different sets of
>>>> properties) are stored in one table, so in case of single_table
>>>> even mandatory properties will have columns will allow null-values.
>>>>
>>>> However, this part of the logic should not have changed from the
>>>> build of september to now.
>>>>
>>>> Can you post (a part of) the ecore and the resulting mapping for
>>>> that part?
>>>>
>>>> gr. Martin
>>>>
>>>> Yigal wrote:
>>>>> In my eCore file I have attributes that are set to required.
>>>>> In the TENEO release: v200709051239, the mapping file will create
>>>>> the attribute "not-null=true".
>>>>> In the TENEO release: v200804071116, the mapping file has the
>>>>> attribute "not-null=false".
>>>>>
>>>>> What changed and how can I fix it?
>>>>>
>>>>> Yigal.
>>>>
>>>>
>>>
>>
>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Hibernate map does not have the required flag set [message #477243 is a reply to message #477241] |
Mon, 14 April 2008 13:54 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Ed,
Support for extended metadata has been provided by UML2 for some time, via
the Ecore profile; note that you need to enable the 'Ecore Tagged Values'
option. Support for generic Ecore annotations was added during the current
development cycle via the 'Annotation Details' option - see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=184249.
Kenn
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:ftqf6s$bsf$1@build.eclipse.org...
> I'm adding the UML2 newsgroup to the "to" list of the reply to ask if it's
> true that UML's Ecore stereotype support doesn't support specifying Ecore
> EAnnotations? I did notice that exporting an Ecore model containing
> extended metadata annotations doesn't seem to preserve them, even when I
> choose to "Process" the annotations. Lack of support for EAnnotations
> seems very unfortunate. Ecore -> XSD -> Ecore preserves annotations so it
> would be awfully nice if Ecore -> UML2 -> Ecore were capable of that as
> well. Given that UML extends EModelElement I can imagine it should be
> possible...
>
> Yigal wrote:
>> Martin,
>> I agree with your final note that the system needs to be more flexible.
>> I do not think we need to have double data files.
>>
>> Today, I have two files, one is the eCore file and another file is a
>> smart utility I wrote that modifies the eCore file and adds the JPA
>> annotations for length and validation.
>> I'm using the IBM product RSA to design my application and it has
>> limitation on setting the eCore. Each time we change the the design, we
>> need to regenerate the eCore and lose all annotation (except documents).
>> The RSA uses the internal eCore values of lower bound = 1 for required.
>> I can had into my tool to had the nullability smart, but I would prefer
>> it too be part of the eCore.
>>
>> thanks
>> Yigal
>>
>> Martin Taal wrote:
>>> Hi Yigal,
>>> The EntityName attribute has a column annotation which does not set the
>>> nullable property (of the Column annotation). The main change since
>>> september is that if there is a column annotation then the nullability
>>> of the column annotation determines the nullability of the column tag in
>>> the hibernate mapping.
>>> The default value of nullable in ColumnImpl is true, so if nullable is
>>> not set in the column annotation then the resulting column will be
>>> nullable.
>>> This could be improved so that the system checks if nullable is set in
>>> the column annotation and if not, use the isrequired from the
>>> eattribute.
>>> I will change this in the coming days.
>>>
>>> gr. Martin
>>>
>>> Yigal wrote:
>>>> Martin
>>>> I'm attaching a partial of my eCore. The Part is based on
>>>> "EntityItem".
>>>> Based on previous release of EMF 2.3.1, setting the lower bound to 1
>>>> and upper bound to one indicates that the attribute is required.
>>>> In this class the attributes "EntityName" and "name" are set that way.
>>>> In the previous release of TENEO I would get a required field. However
>>>> now I get no required.
>>>>
>>>> Yigal
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Yigal,
>>>>> The logic for determining nullability of columns/properties has
>>>>> changed in the latest build. One reason is this bugzilla:
>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=225717
>>>>>
>>>>> A reason why even required properties get a nullable column is: in
>>>>> case of single-table inheritance mapping all properties will get a
>>>>> not-null=false because different objects (with different sets of
>>>>> properties) are stored in one table, so in case of single_table even
>>>>> mandatory properties will have columns will allow null-values.
>>>>>
>>>>> However, this part of the logic should not have changed from the build
>>>>> of september to now.
>>>>>
>>>>> Can you post (a part of) the ecore and the resulting mapping for that
>>>>> part?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Yigal wrote:
>>>>>> In my eCore file I have attributes that are set to required.
>>>>>> In the TENEO release: v200709051239, the mapping file will create the
>>>>>> attribute "not-null=true".
>>>>>> In the TENEO release: v200804071116, the mapping file has the
>>>>>> attribute "not-null=false".
>>>>>>
>>>>>> What changed and how can I fix it?
>>>>>>
>>>>>> Yigal.
>>>>>
>>>>>
>>>>
>>>
>>>
|
|
|
Re: Hibernate map does not have the required flag set [message #626400 is a reply to message #477241] |
Mon, 14 April 2008 13:54 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Ed,
Support for extended metadata has been provided by UML2 for some time, via
the Ecore profile; note that you need to enable the 'Ecore Tagged Values'
option. Support for generic Ecore annotations was added during the current
development cycle via the 'Annotation Details' option - see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=184249
Kenn
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:ftqf6s$bsf$1@build.eclipse.org...
> I'm adding the UML2 newsgroup to the "to" list of the reply to ask if it's
> true that UML's Ecore stereotype support doesn't support specifying Ecore
> EAnnotations? I did notice that exporting an Ecore model containing
> extended metadata annotations doesn't seem to preserve them, even when I
> choose to "Process" the annotations. Lack of support for EAnnotations
> seems very unfortunate. Ecore -> XSD -> Ecore preserves annotations so it
> would be awfully nice if Ecore -> UML2 -> Ecore were capable of that as
> well. Given that UML extends EModelElement I can imagine it should be
> possible...
>
> Yigal wrote:
>> Martin,
>> I agree with your final note that the system needs to be more flexible.
>> I do not think we need to have double data files.
>>
>> Today, I have two files, one is the eCore file and another file is a
>> smart utility I wrote that modifies the eCore file and adds the JPA
>> annotations for length and validation.
>> I'm using the IBM product RSA to design my application and it has
>> limitation on setting the eCore. Each time we change the the design, we
>> need to regenerate the eCore and lose all annotation (except documents).
>> The RSA uses the internal eCore values of lower bound = 1 for required.
>> I can had into my tool to had the nullability smart, but I would prefer
>> it too be part of the eCore.
>>
>> thanks
>> Yigal
>>
>> Martin Taal wrote:
>>> Hi Yigal,
>>> The EntityName attribute has a column annotation which does not set the
>>> nullable property (of the Column annotation). The main change since
>>> september is that if there is a column annotation then the nullability
>>> of the column annotation determines the nullability of the column tag in
>>> the hibernate mapping.
>>> The default value of nullable in ColumnImpl is true, so if nullable is
>>> not set in the column annotation then the resulting column will be
>>> nullable.
>>> This could be improved so that the system checks if nullable is set in
>>> the column annotation and if not, use the isrequired from the
>>> eattribute.
>>> I will change this in the coming days.
>>>
>>> gr. Martin
>>>
>>> Yigal wrote:
>>>> Martin
>>>> I'm attaching a partial of my eCore. The Part is based on
>>>> "EntityItem".
>>>> Based on previous release of EMF 2.3.1, setting the lower bound to 1
>>>> and upper bound to one indicates that the attribute is required.
>>>> In this class the attributes "EntityName" and "name" are set that way.
>>>> In the previous release of TENEO I would get a required field. However
>>>> now I get no required.
>>>>
>>>> Yigal
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Yigal,
>>>>> The logic for determining nullability of columns/properties has
>>>>> changed in the latest build. One reason is this bugzilla:
>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=225717
>>>>>
>>>>> A reason why even required properties get a nullable column is: in
>>>>> case of single-table inheritance mapping all properties will get a
>>>>> not-null=false because different objects (with different sets of
>>>>> properties) are stored in one table, so in case of single_table even
>>>>> mandatory properties will have columns will allow null-values.
>>>>>
>>>>> However, this part of the logic should not have changed from the build
>>>>> of september to now.
>>>>>
>>>>> Can you post (a part of) the ecore and the resulting mapping for that
>>>>> part?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Yigal wrote:
>>>>>> In my eCore file I have attributes that are set to required.
>>>>>> In the TENEO release: v200709051239, the mapping file will create the
>>>>>> attribute "not-null=true".
>>>>>> In the TENEO release: v200804071116, the mapping file has the
>>>>>> attribute "not-null=false".
>>>>>>
>>>>>> What changed and how can I fix it?
>>>>>>
>>>>>> Yigal.
>>>>>
>>>>>
>>>>
>>>
>>>
|
|
|
Goto Forum:
Current Time: Fri Mar 29 08:40:09 GMT 2024
Powered by FUDForum. Page generated in 0.01553 seconds
|