Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Hibernate map does not have the required flag set
| | |
Re: Hibernate map does not have the required flag set [message #117841 is a reply to message #117829] |
Fri, 11 April 2008 22:35   |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
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.
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Hibernate map does not have the required flag set [message #117941 is a reply to message #117841] |
Sat, 12 April 2008 13:26   |
Yigal Spinner Messages: 124 Registered: July 2009 |
Senior Member |
|
|
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 #117954 is a reply to message #117941] |
Sat, 12 April 2008 13:58   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
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 #117981 is a reply to message #117941] |
Sat, 12 April 2008 19:37   |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Yigal,
I am not sure that your last post is so much of a Teneo topic, Ed already answered on this one. One
question though, why don't you use a separate xml file for the annotations:
http://www.elver.org/hibernate/ejb3_format.html#xml
then your utility can generate the xml once and Teneo can use the xml.
I will change Teneo so that when nullability is not set explicitly in the column annotation then
required (lowerbound) is used. So for this you don't need to change your code.
gr. Martin
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.
>>>>
>>>>
>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Hibernate map does not have the required flag set [message #118306 is a reply to message #117954] |
Mon, 14 April 2008 13:54  |
Eclipse User |
|
|
|
Originally posted by: Kenn.Hussey.embarcadero.com
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 #616212 is a reply to message #117829] |
Fri, 11 April 2008 22:35  |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
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.
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Hibernate map does not have the required flag set [message #616227 is a reply to message #117841] |
Sat, 12 April 2008 13:26  |
Yigal Spinner Messages: 124 Registered: July 2009 |
Senior Member |
|
|
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 #616229 is a reply to message #117941] |
Sat, 12 April 2008 13:58  |
Ed Merks Messages: 32937 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 #616232 is a reply to message #117941] |
Sat, 12 April 2008 19:37  |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Yigal,
I am not sure that your last post is so much of a Teneo topic, Ed already answered on this one. One
question though, why don't you use a separate xml file for the annotations:
http://www.elver.org/hibernate/ejb3_format.html#xml
then your utility can generate the xml once and Teneo can use the xml.
I will change Teneo so that when nullability is not set explicitly in the column annotation then
required (lowerbound) is used. So for this you don't need to change your code.
gr. Martin
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.
>>>>
>>>>
>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Hibernate map does not have the required flag set [message #616290 is a reply to message #117954] |
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: Sun Sep 24 20:19:22 GMT 2023
Powered by FUDForum. Page generated in 0.02872 seconds
|