Title: Castor XML - code generator -Vectors

Hi there, URGENT HELP NEEDED

I hava 2 classes - Tranaction and Financial (one Transaction to many Financials). I generate these classes from schema using Castor. Now I am using JDO and mapping the 2 classes to each other but when I try link them like this below, I get an error because when setting collection type (at point XXXX see below), I don't have a method with return type Vector -- I only have a return type Financial[] for method getFinancial(). My question is : Is it possible to set Castor settings (eg castor.properties) to output code that has a return type Vector (or Array) or how would I specify [collection="Financial"]. Please can you give short example.

Help much appreciated
Jamie

<class name="jdo.databinding.Transaction" identity="lawref">
                <description>Transaction</description>
                <map-to table="transaction" xml="transaction"/>
                <field name="lawref">
                        <sql name="trn_id"/>
                        <bind-xml name="trnId" node="attribute"/>
                </field>
                <field name="ddId">
                        <sql name="dd_id" type="integer"/>
                        <bind-xml name="ddId" node="attribute"/>
                </field>
                <field name="description">
                        <sql name="description"/>
                        <bind-xml name="description" node="element"/>
                </field>
                <field name="reason">
                        <sql name="reason"/>
                        <bind-xml name="reason" node="element"/>
                </field>
                <field name="date">
                        <sql name="date" type="date"/>
                        <bind-xml name="date" node="element"/>
                </field>
                <!-- Transaction has reference to Financial - many financials per transaction  -->
                <field name="financial" type="jdo.databinding.Financial" collection="vector">           (XXXX)
                        <sql many-key="ddId"/>
                        <bind-xml name="financial" node="element"/>
                </field>
        </class>
        <class name="jdo.databinding.Financial" depends="jdo.databinding.Transaction" identity="id">
                <map-to table="financial" xml="financial"/>
                <field name="lawref" type="integer">
                        <sql name="trn_id"/>
                </field>
                <field name="ddId" type="jdo.databinding.Transaction">
                        <sql name="dd_id" type="integer"/>
                </field>
                <field name="id">
                        <sql name="number"/>
                        <bind-xml name="number" node="attribute"/>
                </field>
                <field name="amount">
                        <sql name="amount" type="decimal"/>
                        <bind-xml name="amount" node="element"/>
                </field>
        </class>

Reply via email to