Hi Steffen, Castor is using collection when the maxOccurs attribute is greater than 1. Java 2 collections (arraylist) are used if you specify -types j2 on the command line. You can also set the option on the SourceGenerator API.
Please refer to the Source Generator User guide for more information, Hope that helps, Arnaud > -----Original Message----- > From: Steffen Fiedler [mailto:steffen.fiedler@;sourcepark.de] > Sent: Monday, October 28, 2002 2:49 PM > To: [EMAIL PROTECTED] > Subject: [castor-dev] SourceGenerator and ArrayList > > Hi, > > I try to generate the Code for a Class containing an Arraylist. > Wich type i have to use in the xsd-file? > > In the documentation, i only found the information, that it > is possible. > > I tried: > > <xsd:element name="User"> > <xsd:complexType> > <xsd:sequence> > <xsd:element name="id" type="xsd:integer" > minOccurs="1" maxOccurs="1"/> > <xsd:element name="personId" type="xsd:integer" > minOccurs="1" maxOccurs="1"/> > <xsd:element name="name" type="xsd:string" > minOccurs="1" maxOccurs="1"/> > <xsd:element name="password" type="xsd:string" > minOccurs="1" maxOccurs="1"/> > <xsd:element name="roles" type="xsd:arraylist" > minOccurs="1" maxOccurs="1"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > > But i get the errormessage: > type not found for element: roles > > Can anyone give me an example or link, how to do it correctly? > > Thanks, > Steffen > > ----------------------------------------------------------- > 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
