Mark-

If you specify map-to in the mapping of the classes being auto-named,
Castor will use that instead of the xml-ized java name.

HTH,
Stephen

On 3/15/06, Mark Shifman <[EMAIL PROTECTED]> wrote:
> I have a heterogeneous collection (which contains any number of two
> objects) that I want to marshal.
> Is there a way to somewhere tell the mapper what name to use  for each
> class so I don't get the auto generated names
> that look like xxx-yyy.
>
> fragment of my mapping where paramType is a collection of userParamTO's
> and cvParamTO's:
>     <class name="settingsTO">
>         <field name="paramType" type="java.lang.Object"
>             collection="collection">
>             <bind-xml auto-naming="deriveByClass"/>
>         </field>
>     </class>
>
>     <class name="userParamTO">
>         <field name="name" type="java.lang.String" direct="true">
>             <bind-xml name="name"  node="attribute" />
>         </field>
>         <field name="value" type="java.lang.String" direct="true">
>             <bind-xml name="value" node="attribute" />
>         </field>
>     </class>
>
>     <class name="cvParamTO">
>         <field name="cvLabel" type="java.lang.String" direct="true">
>             <bind-xml name="cvLabel"  node="attribute" />
>         </field>
>         <field name="accession" type="java.lang.String" direct="true">
>             <bind-xml name="accession" node="attribute" />
>         </field>
>         <field name="name" type="java.lang.String" direct="true">
>             <bind-xml name="name"  node="attribute" />
>         </field>
>         <field name="value" type="java.lang.String" direct="true">
>             <bind-xml name="value" node="attribute" />
>         </field>
>     </class>
>
> the marshaled snippet:
> <settings>
>     <user-param-tO name="SEARCH_ENGINE" value="MASCOT"/>
>     <cv-param-tO cvLabel="cvDatabase" accession="protein database"
> name="reference database" value="/usr/database/NCBInr_20060216.fasta"/>
> </settings>
>
> I just want to have userParam and cvParam as the element names not the
> names with"-".
>
> thanks in advance
> mas
>
> --
>  Mark Shifman MD. Ph.D.
>  Yale Center for Medical Informatics
>  Phone (203)737-5219
>  [EMAIL PROTECTED]
>
>
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
>
> [EMAIL PROTECTED]
> -------------------------------------------------
>
>

Reply via email to