Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » fetching non-containment relations eagerly
fetching non-containment relations eagerly [message #77978] Tue, 03 April 2007 14:53 Go to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

hi martin, switching back to the newsgroup as discussed. =)

i'm now trying the following in my .ecore:
<eAnnotations source="teneo.jpa">
<details key="@OneToMany(indexed" value="false)"/>
</eAnnotations>

which works, but this doesn't:

<eAnnotations source="teneo.jpa">
<details key="@OneToMany(fetch" value="EAGER)"/>
</eAnnotations>

this produces the following in my subclass of EPackageImpl:

// @OneToMany
create@OneToManyAnnotations();

which obviously causes a Method undefined error.

why' that?
im using teneo 0.8.0.

cheers, chris


Martin Taal wrote:
> Hi Christian,
> You are using a deprecated notation. Instead of this:
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
>
> you should do this:
>
> <xsd:annotation>
> <xsd:appinfo
> source="teneo.jpa">@OneToMany(indexed=false)</xsd:appinfo >
> </xsd:annotation>
>
>
> As you can see the source is teneo.jpa , key to appinfo and the contents
> of the annotation follow the java annotation style.
>
> To set eager loading you would have something like this:
>
> <xsd:annotation>
> <xsd:appinfo
> source="teneo.jpa">@OneToMany(fetch=EAGER)</xsd:appinfo>
> </xsd:annotation>
>
>
> Yes, eclipse.tools.emf is the correct newsgroup.
>
> Btw, would you mind continuing our discussion on the newsgroup? It can
> also help others.
>
> gr. Martin
>
> Christian Donhofer(@fhcampus) wrote:
>
>> Martin Taal wrote:
Re: fetching non-containment relations eagerly [message #77994 is a reply to message #77978] Tue, 03 April 2007 15:00 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
The eannotation in ecore should something like this:
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
</eAnnotations>

So the key is appinfo ('value' will also work) and the value contains the annotation(s).

gr. Martin

Christian Donhofer wrote:
> hi martin, switching back to the newsgroup as discussed. =)
>
> i'm now trying the following in my .ecore:
> <eAnnotations source="teneo.jpa">
> <details key="@OneToMany(indexed" value="false)"/>
> </eAnnotations>
>
> which works, but this doesn't:
>
> <eAnnotations source="teneo.jpa">
> <details key="@OneToMany(fetch" value="EAGER)"/>
> </eAnnotations>
>
> this produces the following in my subclass of EPackageImpl:
>
> // @OneToMany
> create@OneToManyAnnotations();
>
> which obviously causes a Method undefined error.
>
> why' that?
> im using teneo 0.8.0.
>
> cheers, chris
>
>
> Martin Taal wrote:
>> Hi Christian,
>> You are using a deprecated notation. Instead of this:
>> <eAnnotations source="http://annotation.elver.org/Indexed">
>> <details key="value" value="false"/>
>> </eAnnotations>
>>
>> you should do this:
>>
>> <xsd:annotation>
>> <xsd:appinfo
>> source="teneo.jpa">@OneToMany(indexed=false)</xsd:appinfo >
>> </xsd:annotation>
>>
>>
>> As you can see the source is teneo.jpa , key to appinfo and the contents
>> of the annotation follow the java annotation style.
>>
>> To set eager loading you would have something like this:
>>
>> <xsd:annotation>
>> <xsd:appinfo
>> source="teneo.jpa">@OneToMany(fetch=EAGER)</xsd:appinfo>
>> </xsd:annotation>
>>
>>
>> Yes, eclipse.tools.emf is the correct newsgroup.
>>
>> Btw, would you mind continuing our discussion on the newsgroup? It can
>> also help others.
>>
>> gr. Martin
>>
>> Christian Donhofer(@fhcampus) wrote:
>>
>>> Martin Taal wrote:


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78010 is a reply to message #77994] Tue, 03 April 2007 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

hi martin,

thanks for the tip, it's looking good(the language object works already),
but its not finished yet. i'll post a report in some hours.

cheers, chris

On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:

> Hi Christian,
> The eannotation in ecore should something like this:
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
> </eAnnotations>
>
> So the key is appinfo ('value' will also work) and the value contains the annotation(s).
>
> gr. Martin
>
> Christian Donhofer wrote:
>> hi martin, switching back to the newsgroup as discussed. =)
>>
>> i'm now trying the following in my .ecore:
>> <eAnnotations source="teneo.jpa">
>> <details key="@OneToMany(indexed" value="false)"/>
>> </eAnnotations>
>>
>> which works, but this doesn't:
>>
>> <eAnnotations source="teneo.jpa">
>> <details key="@OneToMany(fetch" value="EAGER)"/>
>> </eAnnotations>
>>
>> this produces the following in my subclass of EPackageImpl:
>>
>> // @OneToMany
>> create@OneToManyAnnotations();
>>
>> which obviously causes a Method undefined error.
>>
>> why' that?
>> im using teneo 0.8.0.
>>
>> cheers, chris
>>
Re: fetching non-containment relations eagerly [message #78025 is a reply to message #78010] Tue, 03 April 2007 16:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

hi again,

the DanglingHref exceptions are gone,
but the serialization looks like this:
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>

might this be caused by the error in EReferencePropertyHandler you told me
about or will i have to fiddle around with some other settings/annotations?

cheers, chris

On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:

> hi martin,
>
> thanks for the tip, it's looking good(the language object works already),
> but its not finished yet. i'll post a report in some hours.
>
> cheers, chris
>
> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>
>> Hi Christian,
>> The eannotation in ecore should something like this:
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>> </eAnnotations>
>>
>> So the key is appinfo ('value' will also work) and the value contains the annotation(s).
>>
>> gr. Martin
>>
>> Christian Donhofer wrote:
>>> hi martin, switching back to the newsgroup as discussed. =)
>>>
>>> i'm now trying the following in my .ecore:
>>> <eAnnotations source="teneo.jpa">
>>> <details key="@OneToMany(indexed" value="false)"/>
>>> </eAnnotations>
>>>
>>> which works, but this doesn't:
>>>
>>> <eAnnotations source="teneo.jpa">
>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>> </eAnnotations>
>>>
>>> this produces the following in my subclass of EPackageImpl:
>>>
>>> // @OneToMany
>>> create@OneToManyAnnotations();
>>>
>>> which obviously causes a Method undefined error.
>>>
>>> why' that?
>>> im using teneo 0.8.0.
>>>
>>> cheers, chris
>>>
Re: fetching non-containment relations eagerly [message #78041 is a reply to message #78025] Tue, 03 April 2007 16:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Is the learningunit read using the same hibernate resource as its referencer?

gr. Martin

Christian Donhofer wrote:
> hi again,
>
> the DanglingHref exceptions are gone,
> but the serialization looks like this:
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
>
> might this be caused by the error in EReferencePropertyHandler you told me
> about or will i have to fiddle around with some other settings/annotations?
>
> cheers, chris
>
> On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:
>
>> hi martin,
>>
>> thanks for the tip, it's looking good(the language object works already),
>> but its not finished yet. i'll post a report in some hours.
>>
>> cheers, chris
>>
>> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>>
>>> Hi Christian,
>>> The eannotation in ecore should something like this:
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>>> </eAnnotations>
>>>
>>> So the key is appinfo ('value' will also work) and the value contains the annotation(s).
>>>
>>> gr. Martin
>>>
>>> Christian Donhofer wrote:
>>>> hi martin, switching back to the newsgroup as discussed. =)
>>>>
>>>> i'm now trying the following in my .ecore:
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="@OneToMany(indexed" value="false)"/>
>>>> </eAnnotations>
>>>>
>>>> which works, but this doesn't:
>>>>
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>>> </eAnnotations>
>>>>
>>>> this produces the following in my subclass of EPackageImpl:
>>>>
>>>> // @OneToMany
>>>> create@OneToManyAnnotations();
>>>>
>>>> which obviously causes a Method undefined error.
>>>>
>>>> why' that?
>>>> im using teneo 0.8.0.
>>>>
>>>> cheers, chris
>>>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78057 is a reply to message #78041] Tue, 03 April 2007 17:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

On Tue, 03 Apr 2007 18:56:47 +0200 wrote Martin Taal:

> Is the learningunit read using the same hibernate resource as its referencer?
>

all objects are being loaded with a single query.
when using
-------------------
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
-------------------
rs.getContents().add(modfo);
i get the result from my last post,

using
-------------------
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));

rs.getContents().addAll(res1.getContents());
-------------------
the xmi looks like this
<lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> dummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A-F507 -E839-DC264DF1A66B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B"
timestamp="2007-03-21T12:22:54.000+0100">
<lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7"
timestamp="2007-03-21T12:22:54.000+0100">
<lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:54.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>

so everything is there, but not in a structured form.
but because of that, i assume everything is in the same resource.
i believe that

------------------------
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
------------------------

does copy everything needed, but somehow destroys the relations.
what do you think?

cheers, chris

> gr. Martin
>
> Christian Donhofer wrote:
>> hi again,
>>
>> the DanglingHref exceptions are gone, but the serialization looks like
>> this:
>> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from
>> ModuleFolder where
>> id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
>>
>> might this be caused by the error in EReferencePropertyHandler you told
>> me about or will i have to fiddle around with some other
>> settings/annotations?
>>
>> cheers, chris
>>
>> On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:
>>
>>> hi martin,
>>>
>>> thanks for the tip, it's looking good(the language object works
>>> already),
>>> but its not finished yet. i'll post a report in some hours.
>>>
>>> cheers, chris
>>>
>>> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>>>
>>>> Hi Christian,
>>>> The eannotation in ecore should something like this:
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>>>> </eAnnotations>
>>>>
>>>> So the key is appinfo ('value' will also work) and the value contains
>>>> the annotation(s).
>>>>
>>>> gr. Martin
>>>>
>>>> Christian Donhofer wrote:
>>>>> hi martin, switching back to the newsgroup as discussed. =)
>>>>>
>>>>> i'm now trying the following in my .ecore:
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="@OneToMany(indexed" value="false)"/>
>>>>> </eAnnotations>
>>>>>
>>>>> which works, but this doesn't:
>>>>>
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>>>> </eAnnotations>
>>>>>
>>>>> this produces the following in my subclass of EPackageImpl:
>>>>>
>>>>> // @OneToMany
>>>>> create@OneToManyAnnotations();
>>>>>
>>>>> which obviously causes a Method undefined error.
>>>>>
>>>>> why' that?
>>>>> im using teneo 0.8.0.
>>>>>
>>>>> cheers, chris
>>>>>
>>
Re: fetching non-containment relations eagerly [message #78073 is a reply to message #78057] Tue, 03 April 2007 17:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

sorry, that was a bit messy.

the second variant is off course

rs.getContents().addAll(res1.getContents());

without

ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));


cheers, chris

On Tue, 03 Apr 2007 19:05:49 +0200 wrote Christian Donhofer:

> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>
> rs.getContents().addAll(res1.getContents());
Re: fetching non-containment relations eagerly [message #78088 is a reply to message #78057] Tue, 03 April 2007 17:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Is the ereference pointing to the learningunit a containment reference?

Can you try EcoreUtil.copyAll(res1.getContents())? This should also copy the learningunit (if it is
in the root of the resource) and also set the ereferences to this copied eobject.

gr. Martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 18:56:47 +0200 wrote Martin Taal:
>
>> Is the learningunit read using the same hibernate resource as its referencer?
>>
>
> all objects are being loaded with a single query.
> when using
> -------------------
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
> -------------------
> rs.getContents().add(modfo);
> i get the result from my last post,
>
> using
> -------------------
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>
> rs.getContents().addAll(res1.getContents());
> -------------------
> the xmi looks like this
> <lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit> dummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A-F507 -E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B"
> timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7"
> timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:54.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
>
> so everything is there, but not in a structured form.
> but because of that, i assume everything is in the same resource.
> i believe that
>
> ------------------------
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
> ------------------------
>
> does copy everything needed, but somehow destroys the relations.
> what do you think?
>
> cheers, chris
>
>> gr. Martin
>>
>> Christian Donhofer wrote:
>>> hi again,
>>>
>>> the DanglingHref exceptions are gone, but the serialization looks like
>>> this:
>>> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from
>>> ModuleFolder where
>>> id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
>>>
>>> might this be caused by the error in EReferencePropertyHandler you told
>>> me about or will i have to fiddle around with some other
>>> settings/annotations?
>>>
>>> cheers, chris
>>>
>>> On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:
>>>
>>>> hi martin,
>>>>
>>>> thanks for the tip, it's looking good(the language object works
>>>> already),
>>>> but its not finished yet. i'll post a report in some hours.
>>>>
>>>> cheers, chris
>>>>
>>>> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>>>>
>>>>> Hi Christian,
>>>>> The eannotation in ecore should something like this:
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>>>>> </eAnnotations>
>>>>>
>>>>> So the key is appinfo ('value' will also work) and the value contains
>>>>> the annotation(s).
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Christian Donhofer wrote:
>>>>>> hi martin, switching back to the newsgroup as discussed. =)
>>>>>>
>>>>>> i'm now trying the following in my .ecore:
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="@OneToMany(indexed" value="false)"/>
>>>>>> </eAnnotations>
>>>>>>
>>>>>> which works, but this doesn't:
>>>>>>
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>>>>> </eAnnotations>
>>>>>>
>>>>>> this produces the following in my subclass of EPackageImpl:
>>>>>>
>>>>>> // @OneToMany
>>>>>> create@OneToManyAnnotations();
>>>>>>
>>>>>> which obviously causes a Method undefined error.
>>>>>>
>>>>>> why' that?
>>>>>> im using teneo 0.8.0.
>>>>>>
>>>>>> cheers, chris
>>>>>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78102 is a reply to message #78073] Tue, 03 April 2007 17:11 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Our posts crossed eachother, see still my first question.
Is the ereference pointing to the learningunit a containment reference?

When you look in the rs resource is the learningunit there and when you debug does the LuNode point
to a learningunit it is same resource (rs)?

gr. Martin

Christian Donhofer wrote:
> sorry, that was a bit messy.
>
> the second variant is off course
>
> rs.getContents().addAll(res1.getContents());
>
> without
>
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>
>
> cheers, chris
>
> On Tue, 03 Apr 2007 19:05:49 +0200 wrote Christian Donhofer:
>
>> ModuleFolder modfo =
>> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>>
>> rs.getContents().addAll(res1.getContents());
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78117 is a reply to message #78088] Tue, 03 April 2007 17:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

On Tue, 03 Apr 2007 19:09:05 +0200 wrote Martin Taal:

> Is the ereference pointing to the learningunit a containment reference?
>

no, not a containment relation. LUs are contained within a LUFolder, and
referenced by everything else, f.i. LUNodes.

example xmi
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:childnodes>

> Can you try EcoreUtil.copyAll(res1.getContents())? This should also copy the learningunit (if it is
> in the root of the resource) and also set the ereferences to this copied eobject.

Collection myCol = EcoreUtil.copyAll(res1.getContents());
throws a ConcurrentModificationException

>
> gr. Martin
>
cheers, chris
Re: fetching non-containment relations eagerly [message #78132 is a reply to message #78117] Tue, 03 April 2007 17:38 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Okay that it is not a containment reference, explains why the serialization translates the object
into a href-like string (afaiu).

When you look in the rs resource is the learningunit there and when you debug does the LuNode point
to a learningunit it is same resource (rs)?

Does the serialized string contain the LearningUnit object in the root?

gr. martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 19:09:05 +0200 wrote Martin Taal:
>
>> Is the ereference pointing to the learningunit a containment reference?
>>
>
> no, not a containment relation. LUs are contained within a LUFolder, and
> referenced by everything else, f.i. LUNodes.
>
> example xmi
> <lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:childnodes>
>
>> Can you try EcoreUtil.copyAll(res1.getContents())? This should also copy the learningunit (if it is
>> in the root of the resource) and also set the ereferences to this copied eobject.
>
> Collection myCol = EcoreUtil.copyAll(res1.getContents());
> throws a ConcurrentModificationException
>
>> gr. Martin
>>
> cheers, chris


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78146 is a reply to message #78132] Tue, 03 April 2007 18:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

On Tue, 03 Apr 2007 19:38:20 +0200 wrote Martin Taal:

> Okay that it is not a containment reference, explains why the serialization translates the object
> into a href-like string (afaiu).
>
> When you look in the rs resource is the learningunit there and when you debug does the LuNode point
> to a learningunit it is same resource (rs)?
>

yes, the LU is present(in both resources) - but i cant see whether its
just a pointer to another resource or really present in the resource - i
can navigate to it in the "variables" list (eclipse debug perspective).


> Does the serialized string contain the LearningUnit object in the root?
>

here's the full output:
--------
<?xml version="1.0" encoding="UTF-8"?>
<lobj:ModuleFolder xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
<lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
<lobj:moduleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
<lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
<lobj:module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
<lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
<lobj:didacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
<lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:31.000+0100</creationDate>
</lobj:moduleMeta>
<lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932">
<lobj:childnodes xsi:type="lobj:ThemeNode" id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
<lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100">
<lobj:simpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
<lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
<title>- kein Titel -</title>
</lobj:simpleDidacMeta>
</lobj:theme>
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:childnodes>
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-DCDF4C 0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:childnodes>
</lobj:childnodes>
</lobj:rootNode>
</lobj:module>
</lobj:moduleFolder>
</lobj:ModuleFolder>
--------

> gr. martin
>
cheers, chris
Re: fetching non-containment relations eagerly [message #78160 is a reply to message #78146] Tue, 03 April 2007 18:12 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
The eobject has an eProperties member which has an eResource member, Does this member point to the
rs resource (for the learningunit)?
After doing this:
rs.getContents().addAll(res1.getContents());
the content of res1 should be empty and all objects in res1 should be in rs. Is that the case?

To be sure, the lu object is present in the top/root of the rs resource?
If so then I don't understand why the serialized string does not contain the learningunit.
How do you serialize?

gr. Martin

Christian Donhofer wrote:
>
>
> On Tue, 03 Apr 2007 19:38:20 +0200 wrote Martin Taal:
>
>> Okay that it is not a containment reference, explains why the serialization translates the object
>> into a href-like string (afaiu).
>>
>> When you look in the rs resource is the learningunit there and when you debug does the LuNode point
>> to a learningunit it is same resource (rs)?
>>
>
> yes, the LU is present(in both resources) - but i cant see whether its
> just a pointer to another resource or really present in the resource - i
> can navigate to it in the "variables" list (eclipse debug perspective).
>
>
>> Does the serialized string contain the LearningUnit object in the root?
>>
>
> here's the full output:
> --------
> <?xml version="1.0" encoding="UTF-8"?>
> <lobj:ModuleFolder xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
> <lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> <lobj:moduleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
> <lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> <lobj:module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
> <lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
> <lobj:didacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
> <lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:31.000+0100</creationDate>
> </lobj:moduleMeta>
> <lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932">
> <lobj:childnodes xsi:type="lobj:ThemeNode" id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
> <lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100">
> <lobj:simpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
> <lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:simpleDidacMeta>
> </lobj:theme>
> <lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:childnodes>
> <lobj:childnodes xsi:type="lobj:LuNode" id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-DCDF4C 0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:childnodes>
> </lobj:childnodes>
> </lobj:rootNode>
> </lobj:module>
> </lobj:moduleFolder>
> </lobj:ModuleFolder>
> --------
>
>> gr. martin
>>
> cheers, chris


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78175 is a reply to message #78160] Tue, 03 April 2007 18:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

On Tue, 03 Apr 2007 20:12:27 +0200 wrote Martin Taal:

> The eobject has an eProperties member which has an eResource member, Does this member point to the
> rs resource (for the learningunit)?

no, it points to the hibernate resource res1!
(after calling
rs.getContents().add(modfo);
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
)

> After doing this:
> rs.getContents().addAll(res1.getContents());
> the content of res1 should be empty and all objects in res1 should be in rs. Is that the case?
>
all of the objects in res1 are in rs, but still in res1, too.

> To be sure, the lu object is present in the top/root of the rs resource?
> If so then I don't understand why the serialized string does not contain the learningunit.

yes, the LearningUnit is at the root level of contents in rs, but that
produces ther XMI string at the bottom of this post(p.s.).


> How do you serialize?
>

like this:
----------------------
public static String resourceToString(Resource rs, String encoding) throws Exception{
EObjectHandler handler = new EObjectHandlerImpl();

StringWriter sw = new StringWriter();
URIConverter.WriteableOutputStream uws = new URIConverter.WriteableOutputStream(sw, encoding);
try{
rs.save(uws, handler.getResourceSaveOptions(""));
}catch(Exception e){
logger.error("ERROR in DatabaseServices.resourceToString...");
throw(e);
}
String myObject = sw.toString();

return myObject;
}
----------------------

> gr. Martin
>

cheers, chris
p.s.:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
<lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
<lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
<lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
<lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
<creationDate>2007-03-21T12:22:31.000+0100</creationDate>
</lobj:moduleMeta>
<lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
</lobj:Module>
<lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:DidacMeta>
<lobj:Language code="de">
<language>Deutsch</language>
</lobj:Language>
<lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
<lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
</lobj:ThemeNode>
<lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-1C391734-EF05 -CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:44.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
<lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
<lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-17FBF85C-6187 -3251-F42D-DDB6889238EE </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-AA39CC32-26EB -701B-1FF5-F079E3A2DF84 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-F4535848-42AF -555D-980F-E46E1BC1FB2F </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</lobj:TitleMeta>
<lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A -F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:54.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
<lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
<lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-5F3C7CE3-B80E -19A7-79AD-E2DC563ABEB3 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-3CEED0D8-1225 -AC7C-E36E-3BBF70319CE7 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-67E547F9-3A13 -F4B5-EB83-F0B9E81398A4 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</lobj:TitleMeta>
<lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:SimpleDidacMeta>
</xmi:XMI>
Re: fetching non-containment relations eagerly [message #78191 is a reply to message #78175] Tue, 03 April 2007 18:53 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Is res1 read from the db? If so then I do not understand this part of the serialized xmi:
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
This seems to come from the xmi files.

Do you do this:
create res1
load res1 from the db
copyall to rs
serialize rs
?

gr. Martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 20:12:27 +0200 wrote Martin Taal:
>
>> The eobject has an eProperties member which has an eResource member, Does this member point to the
>> rs resource (for the learningunit)?
>
> no, it points to the hibernate resource res1!
> (after calling
> rs.getContents().add(modfo);
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
> )
>
>> After doing this:
>> rs.getContents().addAll(res1.getContents());
>> the content of res1 should be empty and all objects in res1 should be in rs. Is that the case?
>>
> all of the objects in res1 are in rs, but still in res1, too.
>
>> To be sure, the lu object is present in the top/root of the rs resource?
>> If so then I don't understand why the serialized string does not contain the learningunit.
>
> yes, the LearningUnit is at the root level of contents in rs, but that
> produces ther XMI string at the bottom of this post(p.s.).
>
>
>> How do you serialize?
>>
>
> like this:
> ----------------------
> public static String resourceToString(Resource rs, String encoding) throws Exception{
> EObjectHandler handler = new EObjectHandlerImpl();
>
> StringWriter sw = new StringWriter();
> URIConverter.WriteableOutputStream uws = new URIConverter.WriteableOutputStream(sw, encoding);
> try{
> rs.save(uws, handler.getResourceSaveOptions(""));
> }catch(Exception e){
> logger.error("ERROR in DatabaseServices.resourceToString...");
> throw(e);
> }
> String myObject = sw.toString();
>
> return myObject;
> }
> ----------------------
>
>> gr. Martin
>>
>
> cheers, chris
> p.s.:
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
> <lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
> <lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
> <lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
> <lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
> <creationDate>2007-03-21T12:22:31.000+0100</creationDate>
> </lobj:moduleMeta>
> <lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
> </lobj:Module>
> <lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:DidacMeta>
> <lobj:Language code="de">
> <language>Deutsch</language>
> </lobj:Language>
> <lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
> <lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
> </lobj:ThemeNode>
> <lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-1C391734-EF05 -CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:44.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
> <lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
> <lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-17FBF85C-6187 -3251-F42D-DDB6889238EE </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-AA39CC32-26EB -701B-1FF5-F079E3A2DF84 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-F4535848-42AF -555D-980F-E46E1BC1FB2F </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </lobj:TitleMeta>
> <lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A -F507-E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:54.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
> <lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
> <lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-5F3C7CE3-B80E -19A7-79AD-E2DC563ABEB3 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-3CEED0D8-1225 -AC7C-E36E-3BBF70319CE7 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-67E547F9-3A13 -F4B5-EB83-F0B9E81398A4 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </lobj:TitleMeta>
> <lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:SimpleDidacMeta>
> </xmi:XMI>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78206 is a reply to message #78191] Tue, 03 April 2007 19:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

On Tue, 03 Apr 2007 20:53:31 +0200 wrote Martin Taal:

> Is res1 read from the db? If so then I do not understand this part of the serialized xmi:
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >

i guess thats because im serializing rs(the XMI resource). here's the
actual code:
----------------
private Object[] loadObject(String id, String encoding, String eclassname,
boolean serialize){
Object[] ret = new Object[]{"", ""};
//create datastore, session and transaction session = getSession();
Transaction tx = session.getTransaction();

SessionController sc = new SessionController(); // when creating a
SessionController you have to pass your HbDataStore instance
sc.setHbDataStore(dataStore);
// register the SessionController, the name is used in the uri of the
resource SessionController.registerSessionController("testsc", sc);

ResourceSet resourceSet = getResourceSet();

Resource rs =
resourceSet.createResource(URI.createURI("soEinDummy.lobj?"+
HibernateResource.SESSION_CONTROLLER_PARAM + "=testsc")); // create an
uri using the SessionController name URI uri1 =
URI.createURI("hibernate://?dsname=" + dataStore.getName() + "&" +
StoreResource.LOAD_STRATEGY_PARAM + "=" + StoreResource.ADD_TO_CONTENTS
+ "&" + HibernateResource.SESSION_CONTROLLER_PARAM +
"=testsc&query1=from "+eclassname+" where id='"+id+"'");

System.out.println("Loading with this QUERY: "+uri1.toString());


// resourceSet has to be set before somehow.. final Resource res1 =
resourceSet.createResource(uri1);

tx.begin();


// now load the resources
try {
res1.load(Collections.EMPTY_MAP);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
tx.commit();


ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));

//rs.getContents().add(modfo); //<--version producing HB uris


rs.getContents().addAll(res1.getContents());



System.out.println("LOADED RESOURCESET CONTAINS
"+res1.getResourceSet().getResources().size()+" RESOURCES!");


if(serialize){
System.out.println("CD DEBUG: SERIALIZING OBJECTS!"); //translate
resource into string
String myObject = "";
try{
myObject = resourceToString(rs, encoding);
}catch(Exception e){
System.out.println("EXCEPTION WHEN SERIALIZING:"); e.printStackTrace();
//return error/status code and exit
//500 - Internal Server Error
ret[0] = "500";
return ret;
}
// return xml-String
ret[1] = myObject;
}else{
System.out.println("CD DEBUG: NOT SERIALIZING OBJECTS!"); //ret[1] = eo;
}
// end transaction & session
session.close();

return ret;
}
----------------

when replacing

rs.getContents().addAll(res1.getContents());

with

rs.getContents().add(modfo);

i get the "hibernate://" style uris like this one:
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-DCDF4C 0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:childnodes>

which means that the reference linked to the hibernate resource res1,
probably because i only copy the top level object directly to rs from res1.


> This seems to come from the xmi files.
>
> Do you do this:
> create res1
> load res1 from the db
> copyall to rs
> serialize rs
> ?
Re: fetching non-containment relations eagerly [message #78221 is a reply to message #78206] Tue, 03 April 2007 19:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

i just sent you the method source per mail, too - for hopefully better
readability.
Re: fetching non-containment relations eagerly [message #78236 is a reply to message #78221] Tue, 03 April 2007 19:13 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
Okay, why do you create the rs resource using the resourceset using the uri with a
sessioncontroller? Is it also read from the db?

What happens if you create an empty XMI resource and only the res1 resource as you do now and then
myXMIResource.getContents().addAll(res1.getContents());

and then serialize the myXMIResource.

gr. Martin

Christian Donhofer wrote:
> i just sent you the method source per mail, too - for hopefully better
> readability.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78251 is a reply to message #78236] Tue, 03 April 2007 19:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

On Tue, 03 Apr 2007 21:13:56 +0200 wrote Martin Taal:

> Hi Christian,
> Okay, why do you create the rs resource using the resourceset using the uri with a
> sessioncontroller? Is it also read from the db?
>

you're right, that was a mistake.
i changed that to
Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));
now(without seeing changes in the result).

> What happens if you create an empty XMI resource and only the res1 resource as you do now and then
> myXMIResource.getContents().addAll(res1.getContents());
>

do you mean like this?:
----------------------
Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));

// create an uri using the SessionController name
URI uri1 = URI.createURI("hibernate://?dsname=" + dataStore.getName() + "&" +
StoreResource.LOAD_STRATEGY_PARAM + "=" + StoreResource.ADD_TO_CONTENTS
+ "&" + HibernateResource.SESSION_CONTROLLER_PARAM + "=testsc&query1=from "+eclassname+" where id='"+id+"'");



// resourceSet has to be set before somehow..
final Resource res1 = resourceSet.createResource(uri1);

tx.begin();

// now load the resources
try {
res1.load(Collections.EMPTY_MAP);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

tx.commit();

rs.getContents().addAll(res1.getContents());
--------------------
> and then serialize the myXMIResource.
>

that outputs everything at toplevel beneatch the XMI root, without
cascading.(see p.s.)

> gr. Martin
>

cheers, christian
p.s.:
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
<lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
<lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
<lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
<lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
<creationDate>2007-03-21T12:22:31.000+0100</creationDate>
</lobj:moduleMeta>
<lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
</lobj:Module>
<lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:DidacMeta>
<lobj:Language code="de">
<language>Deutsch</language>
</lobj:Language>
<lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
<lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
</lobj:ThemeNode>
<lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:44.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
<lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
<lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</lobj:TitleMeta>
<lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit>soEinDummy.lobj#learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:54.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
<lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
<lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</lobj:TitleMeta>
<lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:SimpleDidacMeta>
</xmi:XMI>
Re: fetching non-containment relations eagerly [message #78264 is a reply to message #78251] Tue, 03 April 2007 19:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

i have to leave the office now, thank you for your great help today, i'll
get back to you tomorrow.

cheers, good night, chris
Re: fetching non-containment relations eagerly [message #78276 is a reply to message #78251] Tue, 03 April 2007 20:50 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
I understand now that soEinDummy.lobj is an empty xmi resource.

What do you mean without cascading?
Do you mean that for example the following xmi contains a href and not a real learningunit instance:
<lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:LuNode>

As far as I can see this is correct. LearningUnit is present in the resource (soEindDummy.lobj) and
the reference (soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B) points inside the
resource (soEindDummy.lobj).
The learningUnit is not contained in the LuNode because the ereference has containment==false
(afaik), therefore learningunit is serialized separately and not as part of the LuNode.
So if you deserialize everything it should be correct (LuNode points to the correct learningunit).

Or do I miss/oversee something?

gr. Martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 21:13:56 +0200 wrote Martin Taal:
>
>> Hi Christian,
>> Okay, why do you create the rs resource using the resourceset using the uri with a
>> sessioncontroller? Is it also read from the db?
>>
>
> you're right, that was a mistake.
> i changed that to
> Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));
> now(without seeing changes in the result).
>
>> What happens if you create an empty XMI resource and only the res1 resource as you do now and then
>> myXMIResource.getContents().addAll(res1.getContents());
>>
>
> do you mean like this?:
> ----------------------
> Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));
>
> // create an uri using the SessionController name
> URI uri1 = URI.createURI("hibernate://?dsname=" + dataStore.getName() + "&" +
> StoreResource.LOAD_STRATEGY_PARAM + "=" + StoreResource.ADD_TO_CONTENTS
> + "&" + HibernateResource.SESSION_CONTROLLER_PARAM + "=testsc&query1=from "+eclassname+" where id='"+id+"'");
>
>
>
> // resourceSet has to be set before somehow..
> final Resource res1 = resourceSet.createResource(uri1);
>
> tx.begin();
>
> // now load the resources
> try {
> res1.load(Collections.EMPTY_MAP);
> } catch (IOException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
>
> tx.commit();
>
> rs.getContents().addAll(res1.getContents());
> --------------------
>> and then serialize the myXMIResource.
>>
>
> that outputs everything at toplevel beneatch the XMI root, without
> cascading.(see p.s.)
>
>> gr. Martin
>>
>
> cheers, christian
> p.s.:
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
> <lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
> <lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
> <lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
> <lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
> <creationDate>2007-03-21T12:22:31.000+0100</creationDate>
> </lobj:moduleMeta>
> <lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
> </lobj:Module>
> <lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:DidacMeta>
> <lobj:Language code="de">
> <language>Deutsch</language>
> </lobj:Language>
> <lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
> <lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
> </lobj:ThemeNode>
> <lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:44.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
> <lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
> <lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </lobj:TitleMeta>
> <lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit>soEinDummy.lobj#learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:54.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
> <lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
> <lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </lobj:TitleMeta>
> <lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:SimpleDidacMeta>
> </xmi:XMI>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #78384 is a reply to message #78276] Wed, 04 April 2007 14:03 Go to previous message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

hi!

On Tue, 03 Apr 2007 22:50:38 +0200 wrote Martin Taal:

> Hi Christian,
> I understand now that soEinDummy.lobj is an empty xmi resource.
>
> What do you mean without cascading?
> Do you mean that for example the following xmi contains a href and not a real learningunit instance:
> <lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:LuNode>
>

that would be ok, but Blocks/HypertextBlocks, for instance, should be
nested inside a learningunit. i just posted to the emf newsgroup, since i
believe i might be misunderstanding how EMF works. please have a look at
it, if your time allows!

cheers, chris
Re: fetching non-containment relations eagerly [message #604217 is a reply to message #77978] Tue, 03 April 2007 15:00 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
The eannotation in ecore should something like this:
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
</eAnnotations>

So the key is appinfo ('value' will also work) and the value contains the annotation(s).

gr. Martin

Christian Donhofer wrote:
> hi martin, switching back to the newsgroup as discussed. =)
>
> i'm now trying the following in my .ecore:
> <eAnnotations source="teneo.jpa">
> <details key="@OneToMany(indexed" value="false)"/>
> </eAnnotations>
>
> which works, but this doesn't:
>
> <eAnnotations source="teneo.jpa">
> <details key="@OneToMany(fetch" value="EAGER)"/>
> </eAnnotations>
>
> this produces the following in my subclass of EPackageImpl:
>
> // @OneToMany
> create@OneToManyAnnotations();
>
> which obviously causes a Method undefined error.
>
> why' that?
> im using teneo 0.8.0.
>
> cheers, chris
>
>
> Martin Taal wrote:
>> Hi Christian,
>> You are using a deprecated notation. Instead of this:
>> <eAnnotations source="http://annotation.elver.org/Indexed">
>> <details key="value" value="false"/>
>> </eAnnotations>
>>
>> you should do this:
>>
>> <xsd:annotation>
>> <xsd:appinfo
>> source="teneo.jpa">@OneToMany(indexed=false)</xsd:appinfo >
>> </xsd:annotation>
>>
>>
>> As you can see the source is teneo.jpa , key to appinfo and the contents
>> of the annotation follow the java annotation style.
>>
>> To set eager loading you would have something like this:
>>
>> <xsd:annotation>
>> <xsd:appinfo
>> source="teneo.jpa">@OneToMany(fetch=EAGER)</xsd:appinfo>
>> </xsd:annotation>
>>
>>
>> Yes, eclipse.tools.emf is the correct newsgroup.
>>
>> Btw, would you mind continuing our discussion on the newsgroup? It can
>> also help others.
>>
>> gr. Martin
>>
>> Christian Donhofer(@fhcampus) wrote:
>>
>>> Martin Taal wrote:


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604225 is a reply to message #77994] Tue, 03 April 2007 16:16 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
hi martin,

thanks for the tip, it's looking good(the language object works already),
but its not finished yet. i'll post a report in some hours.

cheers, chris

On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:

> Hi Christian,
> The eannotation in ecore should something like this:
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
> </eAnnotations>
>
> So the key is appinfo ('value' will also work) and the value contains the annotation(s).
>
> gr. Martin
>
> Christian Donhofer wrote:
>> hi martin, switching back to the newsgroup as discussed. =)
>>
>> i'm now trying the following in my .ecore:
>> <eAnnotations source="teneo.jpa">
>> <details key="@OneToMany(indexed" value="false)"/>
>> </eAnnotations>
>>
>> which works, but this doesn't:
>>
>> <eAnnotations source="teneo.jpa">
>> <details key="@OneToMany(fetch" value="EAGER)"/>
>> </eAnnotations>
>>
>> this produces the following in my subclass of EPackageImpl:
>>
>> // @OneToMany
>> create@OneToManyAnnotations();
>>
>> which obviously causes a Method undefined error.
>>
>> why' that?
>> im using teneo 0.8.0.
>>
>> cheers, chris
>>
Re: fetching non-containment relations eagerly [message #604232 is a reply to message #78010] Tue, 03 April 2007 16:43 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
hi again,

the DanglingHref exceptions are gone,
but the serialization looks like this:
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>

might this be caused by the error in EReferencePropertyHandler you told me
about or will i have to fiddle around with some other settings/annotations?

cheers, chris

On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:

> hi martin,
>
> thanks for the tip, it's looking good(the language object works already),
> but its not finished yet. i'll post a report in some hours.
>
> cheers, chris
>
> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>
>> Hi Christian,
>> The eannotation in ecore should something like this:
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>> </eAnnotations>
>>
>> So the key is appinfo ('value' will also work) and the value contains the annotation(s).
>>
>> gr. Martin
>>
>> Christian Donhofer wrote:
>>> hi martin, switching back to the newsgroup as discussed. =)
>>>
>>> i'm now trying the following in my .ecore:
>>> <eAnnotations source="teneo.jpa">
>>> <details key="@OneToMany(indexed" value="false)"/>
>>> </eAnnotations>
>>>
>>> which works, but this doesn't:
>>>
>>> <eAnnotations source="teneo.jpa">
>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>> </eAnnotations>
>>>
>>> this produces the following in my subclass of EPackageImpl:
>>>
>>> // @OneToMany
>>> create@OneToManyAnnotations();
>>>
>>> which obviously causes a Method undefined error.
>>>
>>> why' that?
>>> im using teneo 0.8.0.
>>>
>>> cheers, chris
>>>
Re: fetching non-containment relations eagerly [message #604236 is a reply to message #78025] Tue, 03 April 2007 16:56 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Is the learningunit read using the same hibernate resource as its referencer?

gr. Martin

Christian Donhofer wrote:
> hi again,
>
> the DanglingHref exceptions are gone,
> but the serialization looks like this:
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
>
> might this be caused by the error in EReferencePropertyHandler you told me
> about or will i have to fiddle around with some other settings/annotations?
>
> cheers, chris
>
> On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:
>
>> hi martin,
>>
>> thanks for the tip, it's looking good(the language object works already),
>> but its not finished yet. i'll post a report in some hours.
>>
>> cheers, chris
>>
>> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>>
>>> Hi Christian,
>>> The eannotation in ecore should something like this:
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>>> </eAnnotations>
>>>
>>> So the key is appinfo ('value' will also work) and the value contains the annotation(s).
>>>
>>> gr. Martin
>>>
>>> Christian Donhofer wrote:
>>>> hi martin, switching back to the newsgroup as discussed. =)
>>>>
>>>> i'm now trying the following in my .ecore:
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="@OneToMany(indexed" value="false)"/>
>>>> </eAnnotations>
>>>>
>>>> which works, but this doesn't:
>>>>
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>>> </eAnnotations>
>>>>
>>>> this produces the following in my subclass of EPackageImpl:
>>>>
>>>> // @OneToMany
>>>> create@OneToManyAnnotations();
>>>>
>>>> which obviously causes a Method undefined error.
>>>>
>>>> why' that?
>>>> im using teneo 0.8.0.
>>>>
>>>> cheers, chris
>>>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604242 is a reply to message #78041] Tue, 03 April 2007 17:05 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
On Tue, 03 Apr 2007 18:56:47 +0200 wrote Martin Taal:

> Is the learningunit read using the same hibernate resource as its referencer?
>

all objects are being loaded with a single query.
when using
-------------------
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
-------------------
rs.getContents().add(modfo);
i get the result from my last post,

using
-------------------
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));

rs.getContents().addAll(res1.getContents());
-------------------
the xmi looks like this
<lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> dummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A-F507 -E839-DC264DF1A66B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B"
timestamp="2007-03-21T12:22:54.000+0100">
<lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7"
timestamp="2007-03-21T12:22:54.000+0100">
<lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:54.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>

so everything is there, but not in a structured form.
but because of that, i assume everything is in the same resource.
i believe that

------------------------
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
------------------------

does copy everything needed, but somehow destroys the relations.
what do you think?

cheers, chris

> gr. Martin
>
> Christian Donhofer wrote:
>> hi again,
>>
>> the DanglingHref exceptions are gone, but the serialization looks like
>> this:
>> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from
>> ModuleFolder where
>> id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
>>
>> might this be caused by the error in EReferencePropertyHandler you told
>> me about or will i have to fiddle around with some other
>> settings/annotations?
>>
>> cheers, chris
>>
>> On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:
>>
>>> hi martin,
>>>
>>> thanks for the tip, it's looking good(the language object works
>>> already),
>>> but its not finished yet. i'll post a report in some hours.
>>>
>>> cheers, chris
>>>
>>> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>>>
>>>> Hi Christian,
>>>> The eannotation in ecore should something like this:
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>>>> </eAnnotations>
>>>>
>>>> So the key is appinfo ('value' will also work) and the value contains
>>>> the annotation(s).
>>>>
>>>> gr. Martin
>>>>
>>>> Christian Donhofer wrote:
>>>>> hi martin, switching back to the newsgroup as discussed. =)
>>>>>
>>>>> i'm now trying the following in my .ecore:
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="@OneToMany(indexed" value="false)"/>
>>>>> </eAnnotations>
>>>>>
>>>>> which works, but this doesn't:
>>>>>
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>>>> </eAnnotations>
>>>>>
>>>>> this produces the following in my subclass of EPackageImpl:
>>>>>
>>>>> // @OneToMany
>>>>> create@OneToManyAnnotations();
>>>>>
>>>>> which obviously causes a Method undefined error.
>>>>>
>>>>> why' that?
>>>>> im using teneo 0.8.0.
>>>>>
>>>>> cheers, chris
>>>>>
>>
Re: fetching non-containment relations eagerly [message #604247 is a reply to message #78057] Tue, 03 April 2007 17:07 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
sorry, that was a bit messy.

the second variant is off course

rs.getContents().addAll(res1.getContents());

without

ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));


cheers, chris

On Tue, 03 Apr 2007 19:05:49 +0200 wrote Christian Donhofer:

> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>
> rs.getContents().addAll(res1.getContents());
Re: fetching non-containment relations eagerly [message #604249 is a reply to message #78057] Tue, 03 April 2007 17:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Is the ereference pointing to the learningunit a containment reference?

Can you try EcoreUtil.copyAll(res1.getContents())? This should also copy the learningunit (if it is
in the root of the resource) and also set the ereferences to this copied eobject.

gr. Martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 18:56:47 +0200 wrote Martin Taal:
>
>> Is the learningunit read using the same hibernate resource as its referencer?
>>
>
> all objects are being loaded with a single query.
> when using
> -------------------
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
> -------------------
> rs.getContents().add(modfo);
> i get the result from my last post,
>
> using
> -------------------
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>
> rs.getContents().addAll(res1.getContents());
> -------------------
> the xmi looks like this
> <lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit> dummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A-F507 -E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B"
> timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7"
> timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:54.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
>
> so everything is there, but not in a structured form.
> but because of that, i assume everything is in the same resource.
> i believe that
>
> ------------------------
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
> ------------------------
>
> does copy everything needed, but somehow destroys the relations.
> what do you think?
>
> cheers, chris
>
>> gr. Martin
>>
>> Christian Donhofer wrote:
>>> hi again,
>>>
>>> the DanglingHref exceptions are gone, but the serialization looks like
>>> this:
>>> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from
>>> ModuleFolder where
>>> id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
>>>
>>> might this be caused by the error in EReferencePropertyHandler you told
>>> me about or will i have to fiddle around with some other
>>> settings/annotations?
>>>
>>> cheers, chris
>>>
>>> On Tue, 03 Apr 2007 18:16:42 +0200 wrote Christian Donhofer:
>>>
>>>> hi martin,
>>>>
>>>> thanks for the tip, it's looking good(the language object works
>>>> already),
>>>> but its not finished yet. i'll post a report in some hours.
>>>>
>>>> cheers, chris
>>>>
>>>> On Tue, 03 Apr 2007 17:00:47 +0200 wrote Martin Taal:
>>>>
>>>>> Hi Christian,
>>>>> The eannotation in ecore should something like this:
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="appinfo" value="@ManyToOne(fetch=LAZY)"/>
>>>>> </eAnnotations>
>>>>>
>>>>> So the key is appinfo ('value' will also work) and the value contains
>>>>> the annotation(s).
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Christian Donhofer wrote:
>>>>>> hi martin, switching back to the newsgroup as discussed. =)
>>>>>>
>>>>>> i'm now trying the following in my .ecore:
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="@OneToMany(indexed" value="false)"/>
>>>>>> </eAnnotations>
>>>>>>
>>>>>> which works, but this doesn't:
>>>>>>
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="@OneToMany(fetch" value="EAGER)"/>
>>>>>> </eAnnotations>
>>>>>>
>>>>>> this produces the following in my subclass of EPackageImpl:
>>>>>>
>>>>>> // @OneToMany
>>>>>> create@OneToManyAnnotations();
>>>>>>
>>>>>> which obviously causes a Method undefined error.
>>>>>>
>>>>>> why' that?
>>>>>> im using teneo 0.8.0.
>>>>>>
>>>>>> cheers, chris
>>>>>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604253 is a reply to message #78073] Tue, 03 April 2007 17:11 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Our posts crossed eachother, see still my first question.
Is the ereference pointing to the learningunit a containment reference?

When you look in the rs resource is the learningunit there and when you debug does the LuNode point
to a learningunit it is same resource (rs)?

gr. Martin

Christian Donhofer wrote:
> sorry, that was a bit messy.
>
> the second variant is off course
>
> rs.getContents().addAll(res1.getContents());
>
> without
>
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>
>
> cheers, chris
>
> On Tue, 03 Apr 2007 19:05:49 +0200 wrote Christian Donhofer:
>
>> ModuleFolder modfo =
>> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
>>
>> rs.getContents().addAll(res1.getContents());
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604258 is a reply to message #78088] Tue, 03 April 2007 17:30 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
On Tue, 03 Apr 2007 19:09:05 +0200 wrote Martin Taal:

> Is the ereference pointing to the learningunit a containment reference?
>

no, not a containment relation. LUs are contained within a LUFolder, and
referenced by everything else, f.i. LUNodes.

example xmi
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:childnodes>

> Can you try EcoreUtil.copyAll(res1.getContents())? This should also copy the learningunit (if it is
> in the root of the resource) and also set the ereferences to this copied eobject.

Collection myCol = EcoreUtil.copyAll(res1.getContents());
throws a ConcurrentModificationException

>
> gr. Martin
>
cheers, chris
Re: fetching non-containment relations eagerly [message #604261 is a reply to message #78117] Tue, 03 April 2007 17:38 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Okay that it is not a containment reference, explains why the serialization translates the object
into a href-like string (afaiu).

When you look in the rs resource is the learningunit there and when you debug does the LuNode point
to a learningunit it is same resource (rs)?

Does the serialized string contain the LearningUnit object in the root?

gr. martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 19:09:05 +0200 wrote Martin Taal:
>
>> Is the ereference pointing to the learningunit a containment reference?
>>
>
> no, not a containment relation. LUs are contained within a LUFolder, and
> referenced by everything else, f.i. LUNodes.
>
> example xmi
> <lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:childnodes>
>
>> Can you try EcoreUtil.copyAll(res1.getContents())? This should also copy the learningunit (if it is
>> in the root of the resource) and also set the ereferences to this copied eobject.
>
> Collection myCol = EcoreUtil.copyAll(res1.getContents());
> throws a ConcurrentModificationException
>
>> gr. Martin
>>
> cheers, chris


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604267 is a reply to message #78132] Tue, 03 April 2007 18:07 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
On Tue, 03 Apr 2007 19:38:20 +0200 wrote Martin Taal:

> Okay that it is not a containment reference, explains why the serialization translates the object
> into a href-like string (afaiu).
>
> When you look in the rs resource is the learningunit there and when you debug does the LuNode point
> to a learningunit it is same resource (rs)?
>

yes, the LU is present(in both resources) - but i cant see whether its
just a pointer to another resource or really present in the resource - i
can navigate to it in the "variables" list (eclipse debug perspective).


> Does the serialized string contain the LearningUnit object in the root?
>

here's the full output:
--------
<?xml version="1.0" encoding="UTF-8"?>
<lobj:ModuleFolder xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
<lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
<lobj:moduleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
<lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
<lobj:module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
<lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
<lobj:didacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
<lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:31.000+0100</creationDate>
</lobj:moduleMeta>
<lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932">
<lobj:childnodes xsi:type="lobj:ThemeNode" id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
<lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100">
<lobj:simpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
<lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
<title>- kein Titel -</title>
</lobj:simpleDidacMeta>
</lobj:theme>
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:childnodes>
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-DCDF4C 0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:childnodes>
</lobj:childnodes>
</lobj:rootNode>
</lobj:module>
</lobj:moduleFolder>
</lobj:ModuleFolder>
--------

> gr. martin
>
cheers, chris
Re: fetching non-containment relations eagerly [message #604268 is a reply to message #78146] Tue, 03 April 2007 18:12 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
The eobject has an eProperties member which has an eResource member, Does this member point to the
rs resource (for the learningunit)?
After doing this:
rs.getContents().addAll(res1.getContents());
the content of res1 should be empty and all objects in res1 should be in rs. Is that the case?

To be sure, the lu object is present in the top/root of the rs resource?
If so then I don't understand why the serialized string does not contain the learningunit.
How do you serialize?

gr. Martin

Christian Donhofer wrote:
>
>
> On Tue, 03 Apr 2007 19:38:20 +0200 wrote Martin Taal:
>
>> Okay that it is not a containment reference, explains why the serialization translates the object
>> into a href-like string (afaiu).
>>
>> When you look in the rs resource is the learningunit there and when you debug does the LuNode point
>> to a learningunit it is same resource (rs)?
>>
>
> yes, the LU is present(in both resources) - but i cant see whether its
> just a pointer to another resource or really present in the resource - i
> can navigate to it in the "variables" list (eclipse debug perspective).
>
>
>> Does the serialized string contain the LearningUnit object in the root?
>>
>
> here's the full output:
> --------
> <?xml version="1.0" encoding="UTF-8"?>
> <lobj:ModuleFolder xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
> <lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> <lobj:moduleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
> <lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> <lobj:module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
> <lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
> <lobj:didacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
> <lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:31.000+0100</creationDate>
> </lobj:moduleMeta>
> <lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932">
> <lobj:childnodes xsi:type="lobj:ThemeNode" id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
> <lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100">
> <lobj:simpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
> <lobj:language> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:simpleDidacMeta>
> </lobj:theme>
> <lobj:childnodes xsi:type="lobj:LuNode" id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-1C3917 34-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:childnodes>
> <lobj:childnodes xsi:type="lobj:LuNode" id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-DCDF4C 0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:childnodes>
> </lobj:childnodes>
> </lobj:rootNode>
> </lobj:module>
> </lobj:moduleFolder>
> </lobj:ModuleFolder>
> --------
>
>> gr. martin
>>
> cheers, chris


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604276 is a reply to message #78160] Tue, 03 April 2007 18:44 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
On Tue, 03 Apr 2007 20:12:27 +0200 wrote Martin Taal:

> The eobject has an eProperties member which has an eResource member, Does this member point to the
> rs resource (for the learningunit)?

no, it points to the hibernate resource res1!
(after calling
rs.getContents().add(modfo);
ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
)

> After doing this:
> rs.getContents().addAll(res1.getContents());
> the content of res1 should be empty and all objects in res1 should be in rs. Is that the case?
>
all of the objects in res1 are in rs, but still in res1, too.

> To be sure, the lu object is present in the top/root of the rs resource?
> If so then I don't understand why the serialized string does not contain the learningunit.

yes, the LearningUnit is at the root level of contents in rs, but that
produces ther XMI string at the bottom of this post(p.s.).


> How do you serialize?
>

like this:
----------------------
public static String resourceToString(Resource rs, String encoding) throws Exception{
EObjectHandler handler = new EObjectHandlerImpl();

StringWriter sw = new StringWriter();
URIConverter.WriteableOutputStream uws = new URIConverter.WriteableOutputStream(sw, encoding);
try{
rs.save(uws, handler.getResourceSaveOptions(""));
}catch(Exception e){
logger.error("ERROR in DatabaseServices.resourceToString...");
throw(e);
}
String myObject = sw.toString();

return myObject;
}
----------------------

> gr. Martin
>

cheers, chris
p.s.:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
<lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
<lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
<lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
<lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
<creationDate>2007-03-21T12:22:31.000+0100</creationDate>
</lobj:moduleMeta>
<lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
</lobj:Module>
<lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:DidacMeta>
<lobj:Language code="de">
<language>Deutsch</language>
</lobj:Language>
<lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
<lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
</lobj:ThemeNode>
<lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-1C391734-EF05 -CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:44.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
<lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
<lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-17FBF85C-6187 -3251-F42D-DDB6889238EE </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-AA39CC32-26EB -701B-1FF5-F079E3A2DF84 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-F4535848-42AF -555D-980F-E46E1BC1FB2F </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</lobj:TitleMeta>
<lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A -F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:54.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
<lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
<lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-5F3C7CE3-B80E -19A7-79AD-E2DC563ABEB3 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-3CEED0D8-1225 -AC7C-E36E-3BBF70319CE7 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-67E547F9-3A13 -F4B5-EB83-F0B9E81398A4 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title></title>
</lobj:TitleMeta>
<lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
<title>- kein Titel -</title>
</lobj:SimpleDidacMeta>
</xmi:XMI>
Re: fetching non-containment relations eagerly [message #604279 is a reply to message #78175] Tue, 03 April 2007 18:53 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Is res1 read from the db? If so then I do not understand this part of the serialized xmi:
<lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
This seems to come from the xmi files.

Do you do this:
create res1
load res1 from the db
copyall to rs
serialize rs
?

gr. Martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 20:12:27 +0200 wrote Martin Taal:
>
>> The eobject has an eProperties member which has an eResource member, Does this member point to the
>> rs resource (for the learningunit)?
>
> no, it points to the hibernate resource res1!
> (after calling
> rs.getContents().add(modfo);
> ModuleFolder modfo =
> (ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));
> )
>
>> After doing this:
>> rs.getContents().addAll(res1.getContents());
>> the content of res1 should be empty and all objects in res1 should be in rs. Is that the case?
>>
> all of the objects in res1 are in rs, but still in res1, too.
>
>> To be sure, the lu object is present in the top/root of the rs resource?
>> If so then I don't understand why the serialized string does not contain the learningunit.
>
> yes, the LearningUnit is at the root level of contents in rs, but that
> produces ther XMI string at the bottom of this post(p.s.).
>
>
>> How do you serialize?
>>
>
> like this:
> ----------------------
> public static String resourceToString(Resource rs, String encoding) throws Exception{
> EObjectHandler handler = new EObjectHandlerImpl();
>
> StringWriter sw = new StringWriter();
> URIConverter.WriteableOutputStream uws = new URIConverter.WriteableOutputStream(sw, encoding);
> try{
> rs.save(uws, handler.getResourceSaveOptions(""));
> }catch(Exception e){
> logger.error("ERROR in DatabaseServices.resourceToString...");
> throw(e);
> }
> String myObject = sw.toString();
>
> return myObject;
> }
> ----------------------
>
>> gr. Martin
>>
>
> cheers, chris
> p.s.:
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
> <lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
> <lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
> <lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
> <lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
> <creationDate>2007-03-21T12:22:31.000+0100</creationDate>
> </lobj:moduleMeta>
> <lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
> </lobj:Module>
> <lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:DidacMeta>
> <lobj:Language code="de">
> <language>Deutsch</language>
> </lobj:Language>
> <lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
> <lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
> </lobj:ThemeNode>
> <lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-1C391734-EF05 -CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:44.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
> <lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
> <lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-17FBF85C-6187 -3251-F42D-DDB6889238EE </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-AA39CC32-26EB -701B-1FF5-F079E3A2DF84 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-F4535848-42AF -555D-980F-E46E1BC1FB2F </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </lobj:TitleMeta>
> <lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit> soEinDummy.lobj?sessionController=testsc#learn-DCDF4C0A-088A -F507-E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:54.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
> <lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
> <lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-5F3C7CE3-B80E -19A7-79AD-E2DC563ABEB3 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-3CEED0D8-1225 -AC7C-E36E-3BBF70319CE7 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock"> soEinDummy.lobj?sessionController=testsc#hypbl-67E547F9-3A13 -F4B5-EB83-F0B9E81398A4 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title></title>
> </lobj:TitleMeta>
> <lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >
> <title>- kein Titel -</title>
> </lobj:SimpleDidacMeta>
> </xmi:XMI>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604287 is a reply to message #78191] Tue, 03 April 2007 19:06 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
On Tue, 03 Apr 2007 20:53:31 +0200 wrote Martin Taal:

> Is res1 read from the db? If so then I do not understand this part of the serialized xmi:
> <lobj:language>soEinDummy.lobj?sessionController=testsc#de</lobj:language >

i guess thats because im serializing rs(the XMI resource). here's the
actual code:
----------------
private Object[] loadObject(String id, String encoding, String eclassname,
boolean serialize){
Object[] ret = new Object[]{"", ""};
//create datastore, session and transaction session = getSession();
Transaction tx = session.getTransaction();

SessionController sc = new SessionController(); // when creating a
SessionController you have to pass your HbDataStore instance
sc.setHbDataStore(dataStore);
// register the SessionController, the name is used in the uri of the
resource SessionController.registerSessionController("testsc", sc);

ResourceSet resourceSet = getResourceSet();

Resource rs =
resourceSet.createResource(URI.createURI("soEinDummy.lobj?"+
HibernateResource.SESSION_CONTROLLER_PARAM + "=testsc")); // create an
uri using the SessionController name URI uri1 =
URI.createURI("hibernate://?dsname=" + dataStore.getName() + "&" +
StoreResource.LOAD_STRATEGY_PARAM + "=" + StoreResource.ADD_TO_CONTENTS
+ "&" + HibernateResource.SESSION_CONTROLLER_PARAM +
"=testsc&query1=from "+eclassname+" where id='"+id+"'");

System.out.println("Loading with this QUERY: "+uri1.toString());


// resourceSet has to be set before somehow.. final Resource res1 =
resourceSet.createResource(uri1);

tx.begin();


// now load the resources
try {
res1.load(Collections.EMPTY_MAP);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
tx.commit();


ModuleFolder modfo =
(ModuleFolder)EcoreUtil.copy((EObject)res1.getContents().get (0));

//rs.getContents().add(modfo); //<--version producing HB uris


rs.getContents().addAll(res1.getContents());



System.out.println("LOADED RESOURCESET CONTAINS
"+res1.getResourceSet().getResources().size()+" RESOURCES!");


if(serialize){
System.out.println("CD DEBUG: SERIALIZING OBJECTS!"); //translate
resource into string
String myObject = "";
try{
myObject = resourceToString(rs, encoding);
}catch(Exception e){
System.out.println("EXCEPTION WHEN SERIALIZING:"); e.printStackTrace();
//return error/status code and exit
//500 - Internal Server Error
ret[0] = "500";
return ret;
}
// return xml-String
ret[1] = myObject;
}else{
System.out.println("CD DEBUG: NOT SERIALIZING OBJECTS!"); //ret[1] = eo;
}
// end transaction & session
session.close();

return ret;
}
----------------

when replacing

rs.getContents().addAll(res1.getContents());

with

rs.getContents().add(modfo);

i get the "hibernate://" style uris like this one:
<lobj:childnodes xsi:type="lobj:LuNode" id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit> hibernate://?dsname=AuthortoolDataStore&loadStrategy=add ToContents&sessionController=testsc&query1=from ModuleFolder where id='modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C'#learn-DCDF4C 0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:childnodes>

which means that the reference linked to the hibernate resource res1,
probably because i only copy the top level object directly to rs from res1.


> This seems to come from the xmi files.
>
> Do you do this:
> create res1
> load res1 from the db
> copyall to rs
> serialize rs
> ?
Re: fetching non-containment relations eagerly [message #604291 is a reply to message #78206] Tue, 03 April 2007 19:08 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
i just sent you the method source per mail, too - for hopefully better
readability.
Re: fetching non-containment relations eagerly [message #604293 is a reply to message #78221] Tue, 03 April 2007 19:13 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
Okay, why do you create the rs resource using the resourceset using the uri with a
sessioncontroller? Is it also read from the db?

What happens if you create an empty XMI resource and only the res1 resource as you do now and then
myXMIResource.getContents().addAll(res1.getContents());

and then serialize the myXMIResource.

gr. Martin

Christian Donhofer wrote:
> i just sent you the method source per mail, too - for hopefully better
> readability.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604299 is a reply to message #78236] Tue, 03 April 2007 19:29 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
On Tue, 03 Apr 2007 21:13:56 +0200 wrote Martin Taal:

> Hi Christian,
> Okay, why do you create the rs resource using the resourceset using the uri with a
> sessioncontroller? Is it also read from the db?
>

you're right, that was a mistake.
i changed that to
Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));
now(without seeing changes in the result).

> What happens if you create an empty XMI resource and only the res1 resource as you do now and then
> myXMIResource.getContents().addAll(res1.getContents());
>

do you mean like this?:
----------------------
Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));

// create an uri using the SessionController name
URI uri1 = URI.createURI("hibernate://?dsname=" + dataStore.getName() + "&" +
StoreResource.LOAD_STRATEGY_PARAM + "=" + StoreResource.ADD_TO_CONTENTS
+ "&" + HibernateResource.SESSION_CONTROLLER_PARAM + "=testsc&query1=from "+eclassname+" where id='"+id+"'");



// resourceSet has to be set before somehow..
final Resource res1 = resourceSet.createResource(uri1);

tx.begin();

// now load the resources
try {
res1.load(Collections.EMPTY_MAP);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

tx.commit();

rs.getContents().addAll(res1.getContents());
--------------------
> and then serialize the myXMIResource.
>

that outputs everything at toplevel beneatch the XMI root, without
cascading.(see p.s.)

> gr. Martin
>

cheers, christian
p.s.:
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
<lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
<lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
<lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
<title>- kein Titel -</title>
</lobj:folderMeta>
</lobj:ModuleFolder>
<lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
<lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
<creationDate>2007-03-21T12:22:31.000+0100</creationDate>
</lobj:moduleMeta>
<lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
</lobj:Module>
<lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:DidacMeta>
<lobj:Language code="de">
<language>Deutsch</language>
</lobj:Language>
<lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
<lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
</lobj:ThemeNode>
<lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
<lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:44.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
<lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
<lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
<lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
<simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
<lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</lobj:TitleMeta>
<lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
<lobj:learningUnit>soEinDummy.lobj#learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
</lobj:LuNode>
<lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
<lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:didacMeta>
<creationDate>2007-03-21T12:22:54.000+0100</creationDate>
</lobj:luMeta>
</lobj:LearningUnit>
<lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
<lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
<lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
<lod>1</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
<lod>2</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
<lod>3</lod>
<rendering>default</rendering>
<lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4 </lobj:block>
</lobj:PresentationBlock>
<lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
<lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
<simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</simpleDidacMeta>
</lobj:blockMeta>
</lobj:HypertextBlock>
<lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
<lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title></title>
</lobj:TitleMeta>
<lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
<lobj:language>soEinDummy.lobj#de</lobj:language>
<title>- kein Titel -</title>
</lobj:SimpleDidacMeta>
</xmi:XMI>
Re: fetching non-containment relations eagerly [message #604302 is a reply to message #78251] Tue, 03 April 2007 19:38 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
i have to leave the office now, thank you for your great help today, i'll
get back to you tomorrow.

cheers, good night, chris
Re: fetching non-containment relations eagerly [message #604304 is a reply to message #78251] Tue, 03 April 2007 20:50 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
I understand now that soEinDummy.lobj is an empty xmi resource.

What do you mean without cascading?
Do you mean that for example the following xmi contains a href and not a real learningunit instance:
<lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
<lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
</lobj:LuNode>

As far as I can see this is correct. LearningUnit is present in the resource (soEindDummy.lobj) and
the reference (soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B) points inside the
resource (soEindDummy.lobj).
The learningUnit is not contained in the LuNode because the ereference has containment==false
(afaik), therefore learningunit is serialized separately and not as part of the LuNode.
So if you deserialize everything it should be correct (LuNode points to the correct learningunit).

Or do I miss/oversee something?

gr. Martin

Christian Donhofer wrote:
> On Tue, 03 Apr 2007 21:13:56 +0200 wrote Martin Taal:
>
>> Hi Christian,
>> Okay, why do you create the rs resource using the resourceset using the uri with a
>> sessioncontroller? Is it also read from the db?
>>
>
> you're right, that was a mistake.
> i changed that to
> Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));
> now(without seeing changes in the result).
>
>> What happens if you create an empty XMI resource and only the res1 resource as you do now and then
>> myXMIResource.getContents().addAll(res1.getContents());
>>
>
> do you mean like this?:
> ----------------------
> Resource rs = resourceSet.createResource(URI.createURI("soEinDummy.lobj"));
>
> // create an uri using the SessionController name
> URI uri1 = URI.createURI("hibernate://?dsname=" + dataStore.getName() + "&" +
> StoreResource.LOAD_STRATEGY_PARAM + "=" + StoreResource.ADD_TO_CONTENTS
> + "&" + HibernateResource.SESSION_CONTROLLER_PARAM + "=testsc&query1=from "+eclassname+" where id='"+id+"'");
>
>
>
> // resourceSet has to be set before somehow..
> final Resource res1 = resourceSet.createResource(uri1);
>
> tx.begin();
>
> // now load the resources
> try {
> res1.load(Collections.EMPTY_MAP);
> } catch (IOException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
>
> tx.commit();
>
> rs.getContents().addAll(res1.getContents());
> --------------------
>> and then serialize the myXMIResource.
>>
>
> that outputs everything at toplevel beneatch the XMI root, without
> cascading.(see p.s.)
>
>> gr. Martin
>>
>
> cheers, christian
> p.s.:
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore">
> <lobj:ModuleFolder id="modfo-27C47B58-71F7-6F08-DDCE-E40D4EBA305C" timestamp="2007-03-21T12:22:20.000+0100">
> <lobj:folderMeta id="folme-B9B50DAC-4C93-6C2C-906C-27CC08836C32" timestamp="2007-03-21T12:22:20.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:ModuleFolder id="modfo-252FEE5B-DD17-8AAA-95EC-2F183B681088" timestamp="2007-03-21T12:22:22.000+0100">
> <lobj:folderMeta id="folme-2D60FC6B-255D-6757-1AAE-443557D3C043" timestamp="2007-03-21T12:22:29.000+0100">
> <title>- kein Titel -</title>
> </lobj:folderMeta>
> </lobj:ModuleFolder>
> <lobj:Module id="modul-B3682DBC-4214-5079-5AFA-D1442772E611" timestamp="2007-03-21T12:22:29.000+0100">
> <lobj:moduleMeta id="modme-1746A529-4DD0-0712-B3FA-EEA5FA1D6BFD" timestamp="2007-03-21T12:22:31.000+0100">
> <creationDate>2007-03-21T12:22:31.000+0100</creationDate>
> </lobj:moduleMeta>
> <lobj:rootNode xsi:type="lobj:ThemeNode" id="theno-E6ECA384-CBC8-05D5-45EE-EF7D4B439932"/>
> </lobj:Module>
> <lobj:DidacMeta id="didme-29DD1E0D-F4D9-A4C9-9FB8-CB1BB8716B39">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:DidacMeta>
> <lobj:Language code="de">
> <language>Deutsch</language>
> </lobj:Language>
> <lobj:ThemeNode id="theno-3919AAAF-2CB9-AFB2-12EB-59F114262B4D">
> <lobj:theme id="theme-8F5F78E5-80A2-C5E6-549A-A74EA345B6AF" timestamp="2007-03-21T12:22:33.000+0100"/>
> </lobj:ThemeNode>
> <lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-1C391734-EF05-CABA-2E9E-7933863BCE4B" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:luMeta id="leame-432C865A-A042-798C-661B-EA8A9E674363" timestamp="2007-03-21T12:22:44.000+0100">
> <lobj:didacMeta id="didme-9BBA1CE3-F623-F80B-3C8F-671E9A12AA5B">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:44.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-206E5F96-A31F-C1B7-C89B-FE42A8119211"/>
> <lobj:CorrBlock id="corbl-7233463F-D96F-6E60-40C2-9158EB0D350E"/>
> <lobj:PresentationBlock id="prebl-DA9B5269-00F4-262A-84DB-96B31770E8C3">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-17FBF85C-6187-3251-F42D-DDB6889238EE" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-CD0D20F6-37E9-83FC-7884-828E5B2B026E" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-A00FD56E-ABBD-DFA4-5F37-C95E666A5300">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-94DE35B4-BBC4-B891-8EAF-ECA6F8F38EF4" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-DD20D74A-96E9-8361-3566-67AD8A90CB6E">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-AA39CC32-26EB-701B-1FF5-F079E3A2DF84" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-D7F583E8-F18C-EAFF-33CE-FF68AD1BDB40" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-129D4844-F7ED-2C0D-E702-5EEC35DA84E2">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-60263238-77DC-0BC4-66E1-C2FEFA34FEAF" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:PresentationBlock id="prebl-E3BF4D5E-BBB0-B784-950C-EE144E5DCBAA">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-F4535848-42AF-555D-980F-E46E1BC1FB2F" timestamp="2007-03-21T12:23:07.000+0100">
> <lobj:blockMeta id="blome-5AA59965-FF07-D9E8-B5BE-2FD29A06C66D" timestamp="2007-03-21T12:23:07.000+0100">
> <simpleDidacMeta id="simme-42D4EE0A-797E-C6C4-35EF-13812FBCC33E">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-23951B34-4B5B-8202-173B-A091C8CEDEAE" timestamp="2007-03-21T12:23:07.000+0100"/>
> <lobj:TitleMeta id="titme-9BCA4D6B-E5B0-7F26-9B4B-1ECE89433600">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </lobj:TitleMeta>
> <lobj:LuNode id="lunod-0900BE6A-D0B1-B88C-0B8C-83C07C34261A">
> <lobj:learningUnit>soEinDummy.lobj#learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B </lobj:learningUnit>
> </lobj:LuNode>
> <lobj:LearningUnit id="learn-DCDF4C0A-088A-F507-E839-DC264DF1A66B" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:luMeta id="leame-17C76A7C-7F99-7B2A-BD8E-4019F57B57B7" timestamp="2007-03-21T12:22:54.000+0100">
> <lobj:didacMeta id="didme-802CC3B9-0C51-2E3D-CBD8-A86D484D94CD">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:didacMeta>
> <creationDate>2007-03-21T12:22:54.000+0100</creationDate>
> </lobj:luMeta>
> </lobj:LearningUnit>
> <lobj:Item id="item-2ACFD644-5C22-3394-351C-8E12A64578C2"/>
> <lobj:CorrBlock id="corbl-E6928623-2050-AC94-3C17-84F897EC61E0"/>
> <lobj:PresentationBlock id="prebl-054DA96C-4B80-9F03-67D4-05D278B9CFC0">
> <lod>1</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-5F3C7CE3-B80E-19A7-79AD-E2DC563ABEB3" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-51687967-5314-D3BA-245E-7237AC5B09F2" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-29FAD89D-8D7A-CDA4-C43D-C43C19D8523F">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E3CB41CC-609A-FC11-78FF-6EFC2CE2AF60" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-28BB4C31-EC26-97C2-EAE0-7AA375EA68C1">
> <lod>2</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-3CEED0D8-1225-AC7C-E36E-3BBF70319CE7" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-F9040586-12CF-A206-6ACA-A1DFD0A6A194" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-C54C85E6-A497-E843-831A-78FFC23863CE">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-A413E8D3-26AB-7EED-FE53-3036373AC004" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:PresentationBlock id="prebl-A4FF4DA7-9296-DDC5-58A2-0449836FBCB5">
> <lod>3</lod>
> <rendering>default</rendering>
> <lobj:block xsi:type="lobj:HypertextBlock">soEinDummy.lobj#hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4 </lobj:block>
> </lobj:PresentationBlock>
> <lobj:HypertextBlock id="hypbl-67E547F9-3A13-F4B5-EB83-F0B9E81398A4" timestamp="2007-03-21T12:23:01.000+0100">
> <lobj:blockMeta id="blome-4F8C0AC9-30E5-1C87-F6B7-EA5D52969B00" timestamp="2007-03-21T12:23:01.000+0100">
> <simpleDidacMeta id="simme-4BFCBA16-BE6D-CD8A-1534-B4F02674CD48">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </simpleDidacMeta>
> </lobj:blockMeta>
> </lobj:HypertextBlock>
> <lobj:HypertextContent id="hypco-E0921B62-747D-53E9-8661-44063AF217C9" timestamp="2007-03-21T12:23:01.000+0100"/>
> <lobj:TitleMeta id="titme-307733BD-EE1A-DF65-0BC2-5DFFB168C4A7">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title></title>
> </lobj:TitleMeta>
> <lobj:SimpleDidacMeta id="simme-A35AC636-3DB6-5817-90D4-B46843E5136E">
> <lobj:language>soEinDummy.lobj#de</lobj:language>
> <title>- kein Titel -</title>
> </lobj:SimpleDidacMeta>
> </xmi:XMI>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: fetching non-containment relations eagerly [message #604341 is a reply to message #78276] Wed, 04 April 2007 14:03 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
hi!

On Tue, 03 Apr 2007 22:50:38 +0200 wrote Martin Taal:

> Hi Christian,
> I understand now that soEinDummy.lobj is an empty xmi resource.
>
> What do you mean without cascading?
> Do you mean that for example the following xmi contains a href and not a real learningunit instance:
> <lobj:LuNode id="lunod-927DAFBB-EBBC-864D-7C29-9CA78A9699B5">
> <lobj:learningUnit>soEinDummy.lobj#learn-1C391734-EF05-CABA-2E9E-7933863BCE4B </lobj:learningUnit>
> </lobj:LuNode>
>

that would be ok, but Blocks/HypertextBlocks, for instance, should be
nested inside a learningunit. i just posted to the emf newsgroup, since i
believe i might be misunderstanding how EMF works. please have a look at
it, if your time allows!

cheers, chris
Previous Topic:Suppress rather than override static JET templates
Next Topic:[Teneo] memory consumption keeps building up
Goto Forum:
  


Current Time: Thu Apr 18 13:00:20 GMT 2024

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

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

Back to the top