Hi all, 

I use the source generator (Castor 0.9.3). 
My xsd file is :

    <element name="product">
        <complexType>
            <sequence>
                <element name="id" type="integer"/>
                <element name="name" type="string" />
                <element name="price" type="float" />
                <element ref="product_detail" minOccurs="0"
maxOccurs="unbounded" />
            </sequence>
        </complexType>
    </element>   
    <element name="product_detail">
        <complexType>
            <sequence>
                <element name="id" type="integer"/>
                <element name="name" type="string" />
            </sequence>
        </complexType>
    </element>

The class generated contains a method :
        public ProductDetail[] getProductDetail()

When I map this class in my mapping.xml, I use :
  <class name="com.linkvest.testcastor.Product"
         identity="id">
    <description>Product definition</description>
    <map-to table="prod" xml="product" />
    <field name="id" type="integer">
      <sql name="id" type="integer" />
      <xml name="id" node="attribute"/>
    </field>
    <field name="name" type="string">
      <sql name="name" type="char" />
      <xml name="name" node="element" />
    </field>
    <field name="price" type="float">
      <sql name="price" type="numeric" />
      <xml name="price" node="element" />
    </field>
    <!-- Product has reference to ProductDetail
         many details per product  -->
    <field name="ProductDetail"
type="com.linkvest.testcastor.ProductDetail" required="true"
           collection="vector">
      <sql many-key="prod_id"/>
      <xml name="detail" node="element" />
    </field>
  </class>
...

But the problem is that when fetch a product in the DB, Castor try to
find a method getProductDetail returning a Vector.
Where is my error ? What do I do wrong ?

Thanks for your help.
Herv�

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

Reply via email to