Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » HibernateResource loading behaviour
HibernateResource loading behaviour [message #603861] Tue, 27 March 2007 06:33
Markus Bischof is currently offline Markus BischofFriend
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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here is the method I'm using for saving =
a resource=20
(which includes&nbsp;only one&nbsp;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>&nbsp;</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>&nbsp;</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>&nbsp;</P>
<P><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
size=3D2></FONT>&nbsp;</P></DIV></BODY></HTML>

------=_NextPart_000_0006_01C7704A.AA1963F0--
Previous Topic:JET2 - declaring custom tags
Next Topic:oAW Xtend - workflow help
Goto Forum:
  


Current Time: Tue Apr 23 11:45:55 GMT 2024

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

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

Back to the top