Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Contents not loading when using FlatEObjectImpl(working on performance improvements)
Contents not loading when using FlatEObjectImpl [message #540046] Mon, 14 June 2010 16:55 Go to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
Hi EMF world --
I'm doing some performance tuning of my EMF code. When I change my .genmodel to extend FlatEObjectImpl instead of BasicEObjectImpl, the generated code no longer returns children when I call eContents().

I do also have some custom settings in the ResourceFactoryImpl as follows:
loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, m_parserPool);
loadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STY LE, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_LAX_WILDCARD_PROCESSING, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_SKIP_ESCAPE, Boolean.TRUE);

loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);

loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_M AP, m_nameToFeatureMap);
loadOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);

Am I supposed to do something else to tell the FlatEObjectImpl to load its children?

thanks

Tamar
Re: Contents not loading when using FlatEObjectImpl [message #540051 is a reply to message #540046] Mon, 14 June 2010 17:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000100060008020703080503
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Tamar,

It should still be returning the right (same as before) list:

@Override
public EList<EObject> eContents()
{
if (eContents == null)
{
eContents = *EContentsEList.createEContentsEList(this)*;
}
return eContents;
}

It's a "view" on all the containment references...


Tamar Cohen wrote:
> Hi EMF world --
> I'm doing some performance tuning of my EMF code. When I change my
> .genmodel to extend FlatEObjectImpl instead of BasicEObjectImpl, the
> generated code no longer returns children when I call eContents().
>
> I do also have some custom settings in the ResourceFactoryImpl as
> follows:
> loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA,
> extendedMetaData);
> loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL,
> m_parserPool);
> loadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STY
> LE, Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_USE_LEXICAL_HANDLER,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_LAX_WILDCARD_PROCESSING,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_SKIP_ESCAPE, Boolean.TRUE);
>
> loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE,
> Boolean.TRUE);
>
> loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS,
> Boolean.FALSE);
> loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_M
> AP, m_nameToFeatureMap);
> loadOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE,
> Boolean.TRUE);
>
> Am I supposed to do something else to tell the FlatEObjectImpl to load
> its children?
>
> thanks
>
> Tamar

--------------000100060008020703080503
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Tamar,<br>
<br>
It should still be returning the right (same as before) list:<small><br>
</small>
<blockquote><small>  @Override</small><br>
<small>  public EList&lt;EObject&gt; eContents()</small><br>
<small>  {</small><br>
<small>    if (eContents == null)</small><br>
<small>    {</small><br>
<small>      eContents = <b>EContentsEList.createEContentsEList(this)</b>;</small ><br>
<small>    }</small><br>
<small>    return eContents;</small><br>
<small>  }</small><br>
</blockquote>
It's a "view" on all the containment references...<br>
<br>
<br>
Tamar Cohen wrote:
<blockquote cite="mid:hv5mtu$ieo$1@build.eclipse.org" type="cite">Hi
EMF world --
<br>
I'm doing some performance tuning of my EMF code.  When I change my
..genmodel to extend FlatEObjectImpl instead of BasicEObjectImpl, the
generated code no longer returns children when I call eContents().
<br>
<br>
I do also have some custom settings in the ResourceFactoryImpl as
follows:
<br>
        loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA,
extendedMetaData);
<br>
        loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL,
m_parserPool);
<br>
         loadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STY
LE, Boolean.TRUE);
<br>
        loadOptions.put(XMLResource.OPTION_USE_LEXICAL_HANDLER,
Boolean.TRUE);
<br>
        loadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING,
Boolean.TRUE);
<br>
        loadOptions.put(XMLResource.OPTION_LAX_WILDCARD_PROCESSING,
Boolean.TRUE);
<br>
        loadOptions.put(XMLResource.OPTION_SKIP_ESCAPE, Boolean.TRUE);
<br>
        <br>
        loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE,
Boolean.TRUE);
<br>
<br>
        loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT,
Boolean.TRUE);
<br>
        loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION,
Boolean.TRUE);
<br>
        loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS,
Boolean.FALSE);
<br>
         loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_M
AP, m_nameToFeatureMap);
<br>
        loadOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE,
Boolean.TRUE);
<br>
<br>
Am I supposed to do something else to tell the FlatEObjectImpl to load
its children?
<br>
<br>
thanks
<br>
<br>
Tamar
<br>
</blockquote>
</body>
</html>

--------------000100060008020703080503--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Contents not loading when using FlatEObjectImpl [message #540122 is a reply to message #540051] Tue, 15 June 2010 03:28 Go to previous messageGo to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
Hi Ed,

Thanks for the confirmation, I thought it should be! Something else must have changed.

Thx
Tamar
Re: Contents not loading when using FlatEObjectImpl [message #558664 is a reply to message #540046] Mon, 13 September 2010 20:23 Go to previous message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
aha! aha! Problem solved.

The issue had NOTHING to do with FlatEObjectImpl; the problem was there are many uris for this type of resource. The default one had changed in the Package. Note to others, make sure your nsURI is correct if you see no children loading under a DocumentRoot!

EMF is once again my friend.

Tamar
Previous Topic:Using EMF with others OSGi
Next Topic:[EMF QUERY] How to get result objects, which are not from the type of the FROM clause?
Goto Forum:
  


Current Time: Fri Apr 26 06:42:43 GMT 2024

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

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

Back to the top