Hi,

Well, my (noob) mapping files looks like this;

<class name="com.foo.User" auto-complete="true">
   <field name="allRaces">
        <bind-xml transient="true" />
   </field>
</class>

I was thinking that the auto-complete part would just figure out the rest of
the fields using introspection and I am just trying to exclude "allRaces"
which is just a method in this case (there is no field allRaces).

Bit of a newbie so any pointers much appreciated :)
Cheers

2008/5/4 Werner Guttmann <[EMAIL PROTECTED]>:

> Hi,
>
> what does your mapping look like for this field in particular ?
>
> Werner
>
> diyfiesta wrote:
> > Hello,
> >
> > I have two getters which return data from the same field but in slightly
> > different ways, for example,
> >
> > private List<String> list;
> >
> > with
> >
> > List<String> getStringsInReverse() {
> > }
> > List<String> getStrings() {
> > }
> >
> > I want to marhsall only one of these. Castor seems to be using the
> getters
> > (the field is actually private), so I'll get both the list of strings
> and
> > the list of strings in reverse in the XML. Can can I prevent one of
> these
> > getters being used, so it'll marshall only the strings to XML?
> >
> > I've tried, <bind-xml transient="true" /> but becuase this is for a
> > field(?), it gives the following error;
> >
> >
> > Caused by: java.lang.IllegalArgumentException: list is not a valid
> > FieldMappingCollectionType
> >       at
> >
> org.exolab.castor.mapping.xml.types.FieldMappingCollectionType.valueOf(FieldMappingCollectionType.java:254)
> >       at
> >
> org.exolab.castor.xml.XMLMappingLoader.createFieldDesc(XMLMappingLoader.java:629)
> >       at
> >
> org.exolab.castor.mapping.loader.AbstractMappingLoader.createFieldDescriptors(AbstractMappingLoader.java:415)
> >       at
> >
> org.exolab.castor.xml.XMLMappingLoader.createClassDescriptor(XMLMappingLoader.java:237)
> >       at
> >
> org.exolab.castor.mapping.loader.AbstractMappingLoader.createClassDescriptors(AbstractMappingLoader.java:262)
> >       at
> >
> org.exolab.castor.xml.XMLMappingLoader.loadMapping(XMLMappingLoader.java:156)
> >       at
> >
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:162)
> >       at
> >
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:128)
> >       at
> org.exolab.castor.xml.Marshaller.setMapping(Marshaller.java:556)
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


-- 
Toby

Reply via email to