Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » util.List instead of EList?
util.List instead of EList? [message #481707] Sun, 23 August 2009 20:04 Go to next message
Eclipse UserFriend
Originally posted by: yoduderoo.netscape.net

Hi,
In order to work with another framework, OpenJPA, I need an EMF feature
that is a java.util.List instead of an EList.

The model is specified in XML Schema. How do I tell the generator that a
given element with maxOccurs="unbounded" is to be implemented as a
java.util.List?

Thanks,chris
Re: util.List instead of EList? [message #481717 is a reply to message #481707] Mon, 24 August 2009 05:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Chris,

Try Suppress EMF Types in the GenModel's Model Features properties.


Yodude wrote:
> Hi,
> In order to work with another framework, OpenJPA, I need an EMF
> feature that is a java.util.List instead of an EList.
>
> The model is specified in XML Schema. How do I tell the generator that
> a given element with maxOccurs="unbounded" is to be implemented as a
> java.util.List?
>
> Thanks,chris


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: util.List instead of EList? [message #481718 is a reply to message #481717] Mon, 24 August 2009 05:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yoduderoo.netscape.net

Hi Ed,
Internally, in the Impl, "Suppress EMF Types" generates an EList,
although the interface is now "List<T> getThings()". Is there a way to
generate an ArrayList for that feature instead? If not, then I will
hand-code an ArrayList to mirror the EList. OpenJPA wraps these features
in a proxy and expects Java collection types, apparently.
Thanks, chris

Ed Merks wrote:
> Chris,
>
> Try Suppress EMF Types in the GenModel's Model Features properties.
>
>
> Yodude wrote:
>> Hi,
>> In order to work with another framework, OpenJPA, I need an EMF
>> feature that is a java.util.List instead of an EList.
>>
>> The model is specified in XML Schema. How do I tell the generator that
>> a given element with maxOccurs="unbounded" is to be implemented as a
>> java.util.List?
>>
>> Thanks,chris
Re: util.List instead of EList? [message #481720 is a reply to message #481718] Mon, 24 August 2009 05:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Chris,

Array lists aren't going to properly support deserialization so that's
likely a dead end path. Perhaps you'd be better off using Teneo's
integration with EclipseLink's JPA support.


Yodude wrote:
> Hi Ed,
> Internally, in the Impl, "Suppress EMF Types" generates an EList,
> although the interface is now "List<T> getThings()". Is there a way to
> generate an ArrayList for that feature instead? If not, then I will
> hand-code an ArrayList to mirror the EList. OpenJPA wraps these
> features in a proxy and expects Java collection types, apparently.
> Thanks, chris
>
> Ed Merks wrote:
>> Chris,
>>
>> Try Suppress EMF Types in the GenModel's Model Features properties.
>>
>>
>> Yodude wrote:
>>> Hi,
>>> In order to work with another framework, OpenJPA, I need an EMF
>>> feature that is a java.util.List instead of an EList.
>>>
>>> The model is specified in XML Schema. How do I tell the generator
>>> that a given element with maxOccurs="unbounded" is to be implemented
>>> as a java.util.List?
>>>
>>> Thanks,chris


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: util.List instead of EList? [message #481722 is a reply to message #481720] Mon, 24 August 2009 06:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yoduderoo.netscape.net

Hi Ed,
The JPA implementation is fixed, can't switch to EclipseLink at this
point. The objects are not deserialized, so that is not a problem.
Thanks, chris

Ed Merks wrote:
> Chris,
>
> Array lists aren't going to properly support deserialization so that's
> likely a dead end path. Perhaps you'd be better off using Teneo's
> integration with EclipseLink's JPA support.
>
>
> Yodude wrote:
>> Hi Ed,
>> Internally, in the Impl, "Suppress EMF Types" generates an EList,
>> although the interface is now "List<T> getThings()". Is there a way to
>> generate an ArrayList for that feature instead? If not, then I will
>> hand-code an ArrayList to mirror the EList. OpenJPA wraps these
>> features in a proxy and expects Java collection types, apparently.
>> Thanks, chris
>>
>> Ed Merks wrote:
>>> Chris,
>>>
>>> Try Suppress EMF Types in the GenModel's Model Features properties.
>>>
>>>
>>> Yodude wrote:
>>>> Hi,
>>>> In order to work with another framework, OpenJPA, I need an EMF
>>>> feature that is a java.util.List instead of an EList.
>>>>
>>>> The model is specified in XML Schema. How do I tell the generator
>>>> that a given element with maxOccurs="unbounded" is to be implemented
>>>> as a java.util.List?
>>>>
>>>> Thanks,chris
Re: util.List instead of EList? [message #481737 is a reply to message #481722] Mon, 24 August 2009 07:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Chris,

Not much of the framework will work. Not even containment will be
properly supported...


Yodude wrote:
> Hi Ed,
> The JPA implementation is fixed, can't switch to EclipseLink at this
> point. The objects are not deserialized, so that is not a problem.
> Thanks, chris
>
> Ed Merks wrote:
>> Chris,
>>
>> Array lists aren't going to properly support deserialization so
>> that's likely a dead end path. Perhaps you'd be better off using
>> Teneo's integration with EclipseLink's JPA support.
>>
>>
>> Yodude wrote:
>>> Hi Ed,
>>> Internally, in the Impl, "Suppress EMF Types" generates an EList,
>>> although the interface is now "List<T> getThings()". Is there a way
>>> to generate an ArrayList for that feature instead? If not, then I
>>> will hand-code an ArrayList to mirror the EList. OpenJPA wraps these
>>> features in a proxy and expects Java collection types, apparently.
>>> Thanks, chris
>>>
>>> Ed Merks wrote:
>>>> Chris,
>>>>
>>>> Try Suppress EMF Types in the GenModel's Model Features properties.
>>>>
>>>>
>>>> Yodude wrote:
>>>>> Hi,
>>>>> In order to work with another framework, OpenJPA, I need an EMF
>>>>> feature that is a java.util.List instead of an EList.
>>>>>
>>>>> The model is specified in XML Schema. How do I tell the generator
>>>>> that a given element with maxOccurs="unbounded" is to be
>>>>> implemented as a java.util.List?
>>>>>
>>>>> Thanks,chris


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: util.List instead of EList? [message #481738 is a reply to message #481737] Mon, 24 August 2009 07:40 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I've done that in the past too when I interfaced with iBatis. Here's
what I've done:

a) Create a setter for the feature setMyList(List)
b) Store the list internally
c) If someone accesses the list with getMyList() the first time:
+ you need to turn of notifications
+ you add all entries of the openjpa proxy list to the feature EList

It works but it's not really nice to work with.

Tom

Ed Merks schrieb:
> Chris,
>
> Not much of the framework will work. Not even containment will be
> properly supported...
>
>
> Yodude wrote:
>> Hi Ed,
>> The JPA implementation is fixed, can't switch to EclipseLink at this
>> point. The objects are not deserialized, so that is not a problem.
>> Thanks, chris
>>
>> Ed Merks wrote:
>>> Chris,
>>>
>>> Array lists aren't going to properly support deserialization so
>>> that's likely a dead end path. Perhaps you'd be better off using
>>> Teneo's integration with EclipseLink's JPA support.
>>>
>>>
>>> Yodude wrote:
>>>> Hi Ed,
>>>> Internally, in the Impl, "Suppress EMF Types" generates an EList,
>>>> although the interface is now "List<T> getThings()". Is there a way
>>>> to generate an ArrayList for that feature instead? If not, then I
>>>> will hand-code an ArrayList to mirror the EList. OpenJPA wraps these
>>>> features in a proxy and expects Java collection types, apparently.
>>>> Thanks, chris
>>>>
>>>> Ed Merks wrote:
>>>>> Chris,
>>>>>
>>>>> Try Suppress EMF Types in the GenModel's Model Features properties.
>>>>>
>>>>>
>>>>> Yodude wrote:
>>>>>> Hi,
>>>>>> In order to work with another framework, OpenJPA, I need an EMF
>>>>>> feature that is a java.util.List instead of an EList.
>>>>>>
>>>>>> The model is specified in XML Schema. How do I tell the generator
>>>>>> that a given element with maxOccurs="unbounded" is to be
>>>>>> implemented as a java.util.List?
>>>>>>
>>>>>> Thanks,chris
Previous Topic:Add and remove commands does not get overridden for one of two defined children
Next Topic:containment or reference -> consequences in generated Editor commands
Goto Forum:
  


Current Time: Fri Apr 26 08:30:04 GMT 2024

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

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

Back to the top