Can you provide me with the complete (though) minimal class mapping you are 
trying to create for Castor JDO, using the classes as generated by the source 
generator. And what does the corresponding complex type def look like ? 

 

Werner

 

________________________________

Von: Sébastien PERES-LABOURDETTE - Public [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 02. April 2007 12:33
An: [email protected]
Betreff: Re: AW: AW: [castor-user] Castor Xsd -> Jdo mapping

 

Sorry, i should have written :



        <field name="blAsReference" type="com.omerin.nc.jdo.Bl" 
collection="arraylist">
            <sql many-key="ncfid" />
        </field>
 
Now MappingException have gone.
 
Thanks.

Sébastien PERES-LABOURDETTE - Public a écrit : 

For the context :
 
I'm doing some Jdo stuff.
 
>From my jdo mapping file, i have :
 
        <field name="bl" type="com.omerin.nc.jdo.Bl" collection="arraylist">
            <sql many-key="ncfid" />
        </field>
 
Now, at run time i got
 
org.exolab.castor.mapping.MappingException: The return type for method
public com.omerin.nc.jdo.Bl[] com.omerin.nc.jdo.Ncf.getBl() does not
match the declared field type java.util.ArrayList
 
How can i solve this ?
 
 
Werner Guttmann a écrit :
  

        Interesting. You are supplying a '-types arraylist' parameter already 
.. ;-). Iow, you should be getting Collection classes (namely 
java.util.(Array)List) already in your generated sources.
         
        Hmm ...
        Werner
         
        ________________________________________
        Von: Sébastien PERES-LABOURDETTE - Public [mailto:[EMAIL PROTECTED] 
        Gesendet: Montag, 02. April 2007 11:40
        An: [email protected]
        Betreff: Re: AW: [castor-user] Castor Xsd -> Jdo mapping
         
        >From sample source gen ".bat".
         
        %JAVA% -cp %CP% org.exolab.castor.builder.SourceGeneratorMain -dest 
d:\java\dev\ofc -i %1.xsd -package %2 -f -types arraylist -type-factory 
arraylist -verbose
         
        Is that correct ?
         
        (JDK-1.6 / Castor-1.1)
         
        Werner Guttmann a écrit : 
        What tool are you using to start source code generation ? Ant ? Maven ? 
         
        Werner
         
          
        -----Ursprüngliche Nachricht-----
        Von: Sébastien PERES-LABOURDETTE - Public [mailto:sebastien.peres-
        [EMAIL PROTECTED]
        Gesendet: Montag, 02. April 2007 10:28
        An: Castor User
        Betreff: [castor-user] Castor Xsd -> Jdo mapping
         
        Hi.
         
        I have an xsd file containing an element :
         
            <xs:element name="ncf">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element ref="bl" minOccurs="0" 
maxOccurs="unbounded"/>
                        <xs:element ref="nature" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                     ......
         
        SourceGenerator generates a getter :
         
            public com.omerin.nc.jdo.Bl[] getBl() {
                com.omerin.nc.jdo.Bl[] array = new com.omerin.nc.jdo.Bl[0];
                return (com.omerin.nc.jdo.Bl[]) this._blList.toArray(array);
            }
         
        This getter returns an array, is there a way to make it return an
        arrayList ?
         
        Thanks
         
        --
        Sébastien PERES-LABOURDETTE
         
        ---------------------------------------------------------------------
        To unsubscribe from this list please visit:
         
            http://xircles.codehaus.org/manage_email
            
         
         
        ---------------------------------------------------------------------
        To unsubscribe from this list please visit:
         
            http://xircles.codehaus.org/manage_email
         
         
         
          
         
          
            

 
  

 

-- 
Sébastien PERES-LABOURDETTE

Reply via email to