Home » Modeling » EMF » [CDO] Multivalued EAttributes
[CDO] Multivalued EAttributes [message #422011] |
Wed, 20 August 2008 10:33 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Hi everyone,
I'm experimenting some problems with multivalued attributes (EAttributes
with upper bound set to -1). I'm using MySQL, which does not support
arrays right (AFAIK), and when CDO tries to insert into the table it
fails. Some other database do have arrays, like postgreSQL. Furthermore,
the query that create the table for such class does not do anything to
specify the array type: it's just added as a simple type. So even if a
database supports this kind of data types, the query to create the
database would be incorrect.
Fixing this doesn't seem obvious, since it is more than just changing
the query syntax in the corresponding DBAdapter. Maybe multivalued
EAttributes should be treat in a common and uniform way like, for
instance, the manner in which multivalued EReferences are handled in CDO
(a table to hold all its values). This way we avoid problems of the
peculiarities of each database to handle arrays. Another way could be
extending DBAdapter with specific methods to handle arrays. Extending
adapters would then define how arrays are handled by overriding these
methods.
Any thoughts?
ViK
|
|
|
Re: [CDO] Multivalued EAttributes [message #422012 is a reply to message #422011] |
Wed, 20 August 2008 11:25 |
|
Hi Vik,
CDO is known currently not to support multi-valued attributes. There is
a Bugzilla:
228190: Provide support for multivalued attributes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=228190
But it's unlikely to be addressed anytime soon because it'd require a
whole lot of effort while there's currently a simple workaround if
you're able to change your model. Just replace the multi-valued
attribute to a multi-valued containment reference to a new class that
stores a single-valued attribute.
HTH.
/Eike
Víctor Roldán Betancort schrieb:
> Hi everyone,
>
> I'm experimenting some problems with multivalued attributes (EAttributes
> with upper bound set to -1). I'm using MySQL, which does not support
> arrays right (AFAIK), and when CDO tries to insert into the table it
> fails. Some other database do have arrays, like postgreSQL. Furthermore,
> the query that create the table for such class does not do anything to
> specify the array type: it's just added as a simple type. So even if a
> database supports this kind of data types, the query to create the
> database would be incorrect.
>
> Fixing this doesn't seem obvious, since it is more than just changing
> the query syntax in the corresponding DBAdapter. Maybe multivalued
> EAttributes should be treat in a common and uniform way like, for
> instance, the manner in which multivalued EReferences are handled in
> CDO (a table to hold all its values). This way we avoid problems of
> the peculiarities of each database to handle arrays. Another way could
> be extending DBAdapter with specific methods to handle arrays.
> Extending adapters would then define how arrays are handled by
> overriding these methods.
>
> Any thoughts?
>
> ViK
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Multivalued EAttributes [message #422016 is a reply to message #422012] |
Wed, 20 August 2008 12:16 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Eike,
now I recall that bug :P Yes, I remember that workaround, but we
definitively cannot change the model, it's critical. I'll try to take
care of this bug. Any initial implementation design ideas are welcome so
I can have something to start :P
Eike Stepper escribió:
> Hi Vik,
>
> CDO is known currently not to support multi-valued attributes. There is
> a Bugzilla:
>
> 228190: Provide support for multivalued attributes
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=228190
>
> But it's unlikely to be addressed anytime soon because it'd require a
> whole lot of effort while there's currently a simple workaround if
> you're able to change your model. Just replace the multi-valued
> attribute to a multi-valued containment reference to a new class that
> stores a single-valued attribute.
>
> HTH.
> /Eike
>
>
> Víctor Roldán Betancort schrieb:
>> Hi everyone,
>>
>> I'm experimenting some problems with multivalued attributes (EAttributes
>> with upper bound set to -1). I'm using MySQL, which does not support
>> arrays right (AFAIK), and when CDO tries to insert into the table it
>> fails. Some other database do have arrays, like postgreSQL. Furthermore,
>> the query that create the table for such class does not do anything to
>> specify the array type: it's just added as a simple type. So even if a
>> database supports this kind of data types, the query to create the
>> database would be incorrect.
>>
>> Fixing this doesn't seem obvious, since it is more than just changing
>> the query syntax in the corresponding DBAdapter. Maybe multivalued
>> EAttributes should be treat in a common and uniform way like, for
>> instance, the manner in which multivalued EReferences are handled in
>> CDO (a table to hold all its values). This way we avoid problems of
>> the peculiarities of each database to handle arrays. Another way could
>> be extending DBAdapter with specific methods to handle arrays.
>> Extending adapters would then define how arrays are handled by
>> overriding these methods.
>>
>> Any thoughts?
>>
>> ViK
|
|
|
Re: [CDO] Multivalued EAttributes [message #422027 is a reply to message #422016] |
Wed, 20 August 2008 13:26 |
|
Víctor Roldán Betancort schrieb:
> Eike,
>
> now I recall that bug :P Yes, I remember that workaround, but we
> definitively cannot change the model, it's critical. I'll try to take
> care of this bug. Any initial implementation design ideas are welcome
> so I can have something to start :P
I commented on https://bugs.eclipse.org/bugs/show_bug.cgi?id=228190 ;-)
>
> Eike Stepper escribió:
>> Hi Vik,
>>
>> CDO is known currently not to support multi-valued attributes. There
>> is a Bugzilla:
>>
>> 228190: Provide support for multivalued attributes
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=228190
>>
>> But it's unlikely to be addressed anytime soon because it'd require a
>> whole lot of effort while there's currently a simple workaround if
>> you're able to change your model. Just replace the multi-valued
>> attribute to a multi-valued containment reference to a new class that
>> stores a single-valued attribute.
>>
>> HTH.
>> /Eike
>>
>>
>> Víctor Roldán Betancort schrieb:
>>> Hi everyone,
>>>
>>> I'm experimenting some problems with multivalued attributes
>>> (EAttributes
>>> with upper bound set to -1). I'm using MySQL, which does not support
>>> arrays right (AFAIK), and when CDO tries to insert into the table it
>>> fails. Some other database do have arrays, like postgreSQL.
>>> Furthermore,
>>> the query that create the table for such class does not do anything
>>> to specify the array type: it's just added as a simple type. So even
>>> if a database supports this kind of data types, the query to create
>>> the database would be incorrect.
>>>
>>> Fixing this doesn't seem obvious, since it is more than just
>>> changing the query syntax in the corresponding DBAdapter. Maybe
>>> multivalued EAttributes should be treat in a common and uniform way
>>> like, for instance, the manner in which multivalued EReferences are
>>> handled in CDO (a table to hold all its values). This way we avoid
>>> problems of the peculiarities of each database to handle arrays.
>>> Another way could be extending DBAdapter with specific methods to
>>> handle arrays. Extending adapters would then define how arrays are
>>> handled by overriding these methods.
>>>
>>> Any thoughts?
>>>
>>> ViK
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Goto Forum:
Current Time: Fri Sep 20 06:33:46 GMT 2024
Powered by FUDForum. Page generated in 0.04921 seconds
|