Hi Kristof,
Even I am nee to castor, but can suggest a few things the way I handle
collections.
(1) Specify the collection type in the mapping file
e.g. collection="vector"
(2) Specify the type of object the collection will contain.
e.g. type="MyObject"
(3) Normally, I also have the mapping defined for the class MyObject.
Hope this helps.
-- Uddhav
----- Original Message -----
From: "Jozsa Kristof" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 19, 2002 5:42 PM
Subject: Re: [castor-dev] Marshalling a vector with Castor XML
> Can someone kindly donate me an answer to the question below please?
>
> Question shortly: can I marshall a vector of objects into xml without a
> mapping file? y/n?
>
> Christopher
>
> On Tue, Jan 15, 2002 at 07:08:26PM +0100, Jozsa Kristof wrote:
> > Hi,
> >
> > I'm a Castor XML beginner, so my question shouldn't be that hard.. :)
I'm
> > trying to marshall a couple of value objects in my project in a finder
> > routine. I guess I don't need any mapping file to do so, the default
> > introspection should just go fine for me.
> >
> > Marshalling them one by one with iterating works, but I'd like to have
one
> > resulting XML string as the output. I've collected all the value objects
> > into a Vector through the iteration (it should be even faster this way),
and
> > tried to marshall that Vector of value objects using the default
marshaller
> > of Castor - which drops a NullPointerException.
> >
> > May I ask, if that (marshalling a vector of objects) should work, should
> > not, or may work if I use a custom mapping file; or what should I do to
get
> > done this?
> >
> > Thanks much in advance,
> > Christopher
> > --
> > .Digital.Yearning.for.Networked.Assassination.and.Xenocide
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> > unsubscribe castor-dev
> >
>
> --
> .Digital.Yearning.for.Networked.Assassination.and.Xenocide
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev