hello keith,
I thought that all this descriptor stuff only works with XML (unmarshall, alter the JAVA objects, marshall back into XMl). I only want to unmarshal a XML file (corresponding to the XML-Scheme, from wich Castro generated java sources) and write the values into certain fields of an oracle database for persistent storing.
While doing so I came across the problems mentioned below. (BTW when I use nested attributes it works, but IMHO it's not as elegant as describing each class).
--christian
Christian,
You don't need to use a mapping file when Castor generated sources
(unless you disabled descriptor generation, of course). Just make sure
the generated descriptors are compiled and you won't need a mapping
file.
--Keith
> Weinzierl Christian wrote:
>
> hello,
> i am having problems when i try to map complexe types from the scheme
> and i did not find any usefull tutrials or anything like that.
>
> example:
> in my xml scheme i have a complexe type address with subelements
> street, ZIP code, state, country. i use this complexe type a couple of
> times in the scheme for billing address, payment address, delivery
> address.
>
> castor creates a class Address with the class fields mentioned above.
> in the other classes which use this complexe type i have classfields
> like billing addres from the address type. till now everything is
> quite clear and easy, but now i am having troubles in mapping these
> classes.
>
> i have the following mapping file:
>
> <class name="xmlImport.COUNTRY_CUSTOMER" identity="LOCAL_CUST_NO">
> <map-to table="XML_COUNTRY_CUSTOMER"/>
> <field required="false" transient="false" direct="false"
> name="p_ADDRESS" type="xmlImport.ADDRESS" >
> <sql name="P_ADDRESS" dirty="check"
> read->
> </field>
> <field required="false" transient="false" direct="false"
> name="d_ADDRESS" type="xmlImport.ADDRESS">
> <sql name="D_ADDRESS" read->
> </field>
> <field name="b_ADDRESS" type="xmlImport.ADDRESS">
> <sql name="B_ADDRESS" read->
> <bind-xml node="element" name="b_-aDDRESS"/>
> </field>
> </class>
>
> now i need to define the mapping for xmlImport.ADDRESS
>
> <class name="xmlImport.ADDRESS">
> <map-to table="???"/> <<<=== where shall i map the class to?
> it is used in several different contexts!!!
> <field name="ZIPCODE" type="string">
> <sql name="ZIPCODE" type="char">
> </field>
> <field name="CITY" type="string">
> <sql name="CITY" type="char" />
> </field>
> <field name="ADDRESS2" type="string">
> <sql name="ADDRESS2" type="char"/>
> </field>
> <field name="ADDRESS1" type="string">
> <sql name="ADDRESS1" type="char"/>
> </field>
> </class>
>
> thanks for your help!
> christian
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
