Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » HibernateResource loading behaviour
HibernateResource loading behaviour [message #76673] |
Tue, 27 March 2007 06:33 |
Markus Bischof Messages: 72 Registered: July 2009 |
Member |
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C7704A.AA1963F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi!
I'm having some trouble handling the resource loading (and perhaps =
saving).=20
Here is the method I'm using for saving a resource (which includes only =
one top level object named "Package"). First I create a new resource =
with a specific URI, then I'm adding some contents to that resource, and =
after that I call the save-method.
Resource hibernateResource =3D =
resourceSet.createResource(URI.createPlatformResourceURI(ran domName+ ".mye=
xtension"));
[adding some contents ]
hibernateResource.save(Collections.EMPTY_MAP);
My problem is, when I want to load a specific Resource again, I receive =
all the to plevel objects (meaning I have all the top level "Packages" =
in that one resource), but my intention was to only load that one =
package, which I saved under the specific URI. Here's the code for that: =
Resource hibernateResource =3D =
resourceSet.createResource(URI.createPlatformResourceURI(sam eRandomNameAs=
Above+".myextension"));hibernateResource.load(Collections.EMPTY_MAP);
------=_NextPart_000_0006_01C7704A.AA1963F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16414" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm having some trouble handling the =
resource=20
loading (and perhaps saving). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Here is the method I'm using for saving =
a resource=20
(which includes only one top level object named "Package"). =
First I=20
create a new resource with a specific URI, then I'm adding some contents =
to that=20
resource, and after that I call the save-method.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<P><FONT face=3DArial size=3D2>Resource hibernateResource =3D=20
resourceSet.createResource(URI.createPlatformResourceURI(ran domName+ ".mye=
xtension"));</FONT></P>
<P><FONT face=3DArial size=3D2>[adding some contents ]</FONT></P>
<P><FONT face=3DArial=20
size=3D2>hibernateResource.save(Collections.EMPTY_MAP);</FONT ></P>
<P><FONT face=3DArial size=3D2>My problem is, when I want to load a =
specific=20
Resource again, I receive all the to plevel objects (meaning I have all =
the top=20
level "Packages" in that one resource), but my intention was to only =
load that=20
one package, which I saved under the specific URI. Here's the code for=20
that:</FONT><FONT face=3DArial size=3D2> </FONT></P>
<P><FONT face=3DArial size=3D2>Resource hibernateResource =3D=20
resourceSet.createResource(URI.createPlatformResourceURI(sam eRandomNameAs=
Above+".myextension"));</FONT><FONT=20
face=3DArial =
size=3D2>hibernateResource.load(Collections.EMPTY_MAP);</FONT ></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
size=3D2></FONT> </P></DIV></BODY></HTML>
------=_NextPart_000_0006_01C7704A.AA1963F0--
|
|
| | | | | | | | | | |
Goto Forum:
Current Time: Sun Sep 22 22:38:10 GMT 2024
Powered by FUDForum. Page generated in 0.04105 seconds
|