Skip to main content



      Home
Home » Modeling » UML2 » Re: Hibernate map does not have the required flag set
Re: Hibernate map does not have the required flag set [message #626398] Sat, 12 April 2008 09:58
Eclipse UserFriend
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.
>>>>
>>>>
>>>
>>
>>
Previous Topic:List of UML2-compatible UML Tools
Next Topic:Re: Hibernate map does not have the required flag set
Goto Forum:
  


Current Time: Sun Aug 31 15:52:46 EDT 2025

Powered by FUDForum. Page generated in 0.02996 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top