Thanks Keith, 

Works 100% ...

-----Original Message-----
From: Keith Visco [mailto:[EMAIL PROTECTED] 
Sent: 25 March 2005 04:30 AM
To: [email protected]
Subject: Re: [castor-user] Marshaller Results not as Expected


Neville,

update your mapping as such:

<class name="za.gov.tshwane.entity.mvc.ScriptLib"
        key-generator="IDENTITY"
        identity="pkScriptLib">
    <map-to xml="ScriptLib" table="DP_MVC.DP_MVC.ScriptLib" />
     ...
</class>

By default castor will use lower-case names with hyphens when automatically
creating an XML name. You can change this to mixed case in the
castor.properties file (you'll see a comment in there), but this will end up
giving you "scriptLib". So the best thing to do is to add the
xml="ScriptLib" to your <map-to> element.

Castor also lets you define your own custom naming pattern by implementing
the XMLNaming interface and specifying it in the castor.properties file.

--Keith



Neville van Deventer wrote:
> HI All,
>  
> I've got a bit os a strange result from the marshaller ...
>  
> The Result is this
>  
> <?xml version="1.0" encoding="UTF-8"?> <vector 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:type="java:java.util.Vector">
> <script-lib>
>       <ScriptName>MVCDetails</ScriptName>
>       <ScriptCall>mvcDetails( </ScriptCall>
>       <ScriptCode>
>               function mvcDetails( pvar ) {
>                       c = document.getElementById( &quot;MVCVar&quot; );
>                       c.value = pvar;
>                       c = document.getElementById( &quot;MVCLogic&quot; );
>                       c.value = 1;
>                       frmMVC.submit();
>               }
>       </ScriptCode>
>       <pkScriptLib>66</pkScriptLib>
> </script-lib>
> </vector>
> 
> The problem is the <script-lib> tag, this is the class of my entity 
> and I need it to be <ScriptLib> (Exactly like the Class Name)
> 
> Here is the Class
> 
> package za.gov.tshwane.entity.mvc;
> /**
>  * @table DP_MVC.DP_MVC.ScriptLib
>  * @key-generator IDENTITY
>  * @cache-type none
>  */
> public class ScriptLib {
>     /**
>      * @primary-key 
>      */
>     private int pkScriptLib;
>     /**
>      * @sql-size 50
>      */
>     private String ScriptName;  
>     /**
>      * @sql-size 100
>      */
>     private String ScriptCall;  
>     /**
>      * @sql-size 2000
>      * @sql-dirty ignore
>      */
>     private String ScriptCode;
> 
>       // All the Getters and Setters are here ...
> }
> 
> And in the Mapping File ...
> 
>   <class name="za.gov.tshwane.entity.mvc.ScriptLib"
key-generator="IDENTITY"
> identity="pkScriptLib">
>     <map-to table="DP_MVC.DP_MVC.ScriptLib" />
>     <cache-type type="none" />
>     <field name="pkScriptLib" type="integer">
>       <sql name="pkScriptLib" />
>       <bind-xml name="pkScriptLib" />
>     </field>
>     <field name="ScriptName" type="string">
>       <sql name="ScriptName" />
>       <bind-xml name="ScriptName" />
>     </field>
>     <field name="ScriptCall" type="string">
>       <sql name="ScriptCall" />
>       <bind-xml name="ScriptCall" />
>     </field>
>     <field name="ScriptCode" type="string">
>       <sql dirty="ignore" name="ScriptCode" />
>       <bind-xml name="ScriptCode" />
>     </field>
>   </class>
> 
> 
> Am I Missing something Simple in the Castor-Doclet or Configuration ???
> 
> 
> Thx in advance for any help ...
> 
> 
> Neville van Deventer
> 
> 
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to 
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user
> 
> 



-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to