id references over multiple files

View: New views
2 Messages — Rating Filter:   Alert me  

id references over multiple files

by Ralf Thielow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

is there a way to manage references of objects over multiple files.

example:

student object with an id on a file like "file1.xml"

<student id=3D"student-1">
        <name>Foo</name>
</student>

which is referenced of a group on the second file "file2.xml"

<groupOfStudents>
        <student reference=3D"student-1"/>
</groupOfStudents>

I want to let the id's with there objects persistent on the memory.
IMHO the storage for the objects is recreated on every instantiating of=20
XStream or every "fromXml" "toXml" call.

Is there a way to do that?

best regards

Ralf Thielow

Re: id references over multiple files

by Jörg Schaible-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ralf,

Ralf Thielow wrote:

> Hello,
>
> is there a way to manage references of objects over multiple files.
>
> example:
>
> student object with an id on a file like "file1.xml"
>
> <student id=3D"student-1">
>         <name>Foo</name>
> </student>
>
> which is referenced of a group on the second file "file2.xml"
>
> <groupOfStudents>
>         <student reference=3D"student-1"/>
> </groupOfStudents>
>
> I want to let the id's with there objects persistent on the memory.
> IMHO the storage for the objects is recreated on every instantiating of=20
> XStream or every "fromXml" "toXml" call.
>
> Is there a way to do that?

There's an example for such a hack in XStream's acceptance tests:

MultipleObjectInOneStream.testSupportOptionToPreserveReferencesAcrossDifferentObjectsInStream

At least this can give you some ideas, where to start :)

- Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email