|
|
|
Re: XMLResource.setID [message #422181 is a reply to message #422180] |
Mon, 25 August 2008 05:34 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------040200060408020509000909
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Ben,
Comments below.
Ben wrote:
> Ed,
>
> The schema that I am using to generate my ecore model does not have
> any xmi:ids declared. I just edit the created ecore model and set the
> ID property to true for the EAttribute that I want to make sure is
> unique.
>
> So, does it mean that EMF will not populate either
> intrinsicIDToEObjectMap or the idToEObjectMap when the resource is
> loaded?
You have to set a map for that map to be populated.
> If that is the case, then will it make any different if I use
> ResourceImpl::setIntrinsicIDToEObjectMap or XMLResourceImpl::setID()?
If you have a model with IDs you shouldn't need to do anything, other
than set this map if you want mapped lookup...
/**
* Sets the map used to cache the EObject identified by the value
of its ID feature.
* This cache is only activated if the map is not <code>null</code>.
* The map will be lazily loaded by the {@link
#getEObjectByID(String) getEObjectByID} method.
* It is up to the client to clear the cache when it becomes invalid,
* e.g., when the ID of a previously mapped EObject is changed.
* @param intrinsicIDToEObjectMap the new map or <code>null</code>.
* @see #getIntrinsicIDToEObjectMap
*/
You should always be able to call Resource.getEObject with your ID and
expect the object with that ID to be returned...
>
> Thanks again Ed.
>
--------------040200060408020509000909
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ben,<br>
<br>
Comments below.<br>
<br>
Ben wrote:
<blockquote
cite="mid:7c214782f53abf555c76872bcc366775$1@www.eclipse.org"
type="cite">Ed,
<br>
<br>
The schema that I am using to generate my ecore model does not have any
xmi:ids declared.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04854 seconds