I not found any responds for this message, so I repost it cause I have the
same problem...

====================== >8 =============================
I don't understand how to map my collection. My generated code (see below)
declare the specItemidList as a Vector, but there is no getSpecItenidList().
There is only an accessor getSpecItemid() that return SpecItemid[]. I don't
know how to make my mapping. If I put collection="Vector", Castor tell me
there is no accessor getSpecItemid() that returns a Vector. I tried with
Array, but there is no handler for array.

Can you help me please ?

my schema :
        <xsd:element name="liste_spec"  minOccurs="0" maxOccurs="1">
                <xsd:complexType>
                        <xsd:element name="spec_itemid" minOccurs="1"
maxOccurs="unbounded">
                        <xsd:complexType name="liste_item_id" >
                                <xsd:attribute name="id" type="xsd:ID"
use="required"/>
                                <xsd:attribute name="libelle"
type="xsd:string" use="required"/>
                                <xsd:attribute name="libelle2"
type="xsd:string" use="required"/>
                        </xsd:complexType>
                        </xsd:element>
                        <xsd:attribute name="id_cpgn" type="xsd:integer"
use="required"/>
                </xsd:complexType>
        </xsd:element>

my mapping :
  <class name="RestoPackage.ListeSpec" identity="idCpgn">
    <description>liste des specialites</description>
    <map-to table="Specialite" xml="liste_spec"/>
    <field name="idCpgn" type="integer">
      <sql name="id_cpgn" type="numeric"/>
    </field>
    <field name="specItemid" type="RestoPackage.SpecItemid"
collection="Vector">
        <sql name="id" many_table="lib_specialite" many_key="id"/>
        <xml name="item"/>
    </field>
  </class>


my generated code :

public class ListeSpec implements java.io.Serializable {

    private int _idCpgn;
    private java.util.Vector _specItemidList;

    public ListeSpec() {
        super();
        _specItemidList = new Vector();
    }

    public java.util.Enumeration enumerateSpecItemid()
    {
        return _specItemidList.elements();
    }

    public SpecItemid[] getSpecItemid()
    {
        int size = _specItemidList.size();
        SpecItemid[] mArray = new SpecItemid[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (SpecItemid) _specItemidList.elementAt(index);
        }
        return mArray;
    }
====================== >8 =============================

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

Reply via email to