Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Multivalued EAttributes
[CDO] Multivalued EAttributes [message #422011] Wed, 20 August 2008 10:33 Go to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
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 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6690
Registered: July 2009
Senior Member
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 #422016 is a reply to message #422012] Wed, 20 August 2008 12:16 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
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 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6690
Registered: July 2009
Senior Member
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


Previous Topic:emf : package not found error while executing CLI frm comm prompt
Next Topic:Using a GeneratorAdapter to produce part of a class
Goto Forum:
  


Current Time: Fri Sep 20 06:33:46 GMT 2024

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

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

Back to the top