Hear is my mapping.xml. I don't know
what must I do to read/write inside Range the RangeValue array. Is something
with the bind-xml becouse the sql query generated by castor looks like those i
was thinking i need.
If it was a single repeatable tag, i
know i have to write in the bind-xml tag, the name of this tag. But in my scheme
i have to write two repatable tags.
So my question could be this, How to
bind two xml-tags inside one castor mappings field???
Thank you very much.
<class
name="Range"
identity="id"
key-generator="HIGH/LOW">
<map-to table="Range"/>
<field name="id">
<sql name="ID_AUDIENCE" type="integer"/>
</field>
<field name="description">
<bind-xml name="Description"/>
<sql name="DESCRIPTION" type="varchar"/>
</field>
<field name="rangeValues"
type="RangeValues">
<sql many-key="ID_AUDIENCE_RANGE"/>
<!--I don't know have must I put hear-->
<bind-xml name=""/>
<!-- -->
</field>
</class>
<class name="RangeValuesItem"
identity="id"
key-generator="HIGH/LOW"
depends="Audience"
>
<map-to table="RangeValues"/>
<field name="id">
<sql name="ID_RANGE_VALUES" type="integer"/>
</field>
<field name="range">
<bind-xml name="Range" node="text"/>
<sql name="RANGE" type="varchar"/>
</field>
<field name="value">
<bind-xml name="Value" node="text"/>
<sql name="VALUE" type="varchar"/>
</field>
<field name="audience" type="audience">
<sql name="ID_AUDIENCE"/>
</field>
</class>
-----Mensaje original-----
De: pedro canales [mailto:[EMAIL PROTECTED]]
Enviado el: lunes, 11 de noviembre de 2002 15:50
Para: [EMAIL PROTECTED]
Asunto: Re: [castor-dev] can Castor do it???
Enrique,
Could you send me a snippet of code how are you
trying to do this?
If you have succeded marshalling your objetcs, I
think is not a big deal making unmarshalling.
Pedro.
>From: "Arnaud Blandin" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Re: [castor-dev] can Castor do it???
>Date: Mon, 11 Nov 2002 14:18:13 +0100
>
>Hi Enrique,
>
>Why not using the Source Generator to generate the java object model
>from the schema?
>The mapping API intends to provide information mostly on the java model
>you want to marshal to xml and unmarshal from xml. It doesn't define an
>XML grammar by itself (even though it lets you specify some XML
>datatyping). What you are asking for is typically the expression of an
>XML Schema rule thus in that case the solution is to use the Source
>Generator.
>
>Hope that helps,
>
>Arnaud
>
>-----Original Message-----
>From: Enrique Rodr�guez [mailto:[EMAIL PROTECTED]]
>Sent: Monday, November 11, 2002 2:01 PM
>To: [EMAIL PROTECTED]
>Subject: [castor-dev] can Castor do it???
>
>Past week i asked for a solution to my problem. i Have to marshall and
>unmarshall an xml document like this...
>
><Range>
> <RangeQualifier>Description</RangeQualifier>
> <RangePrecision>From</RangePrecision>
> <RangeValue>15</RangeValue>
> <RangePrecision>To</RangePrecision>
> <RangeValue>45</RangeValue>
></AudienceRange>
>RangePrecision and RangeValue always are joined, and as you can see, can
>be repeatable.
>the xml-schema can support this, but "I think", castor not.
>If anybody know how can I do it, PLEASE, help me.
>Now, i can make the unmarshal process with something like that:
> <field name="setValues"
> type="RangePrecisionValue"
> collection="vector"
>
>set-method="addRangePrecisionValue">
> <bind-xml node="element" matches="*"/>
> </field>
>I add some code to the method addRangePrecisionValue. In this method i
>receive all the tags values and create the objects I need. But I don't
>find any clue with the marshall process.
>Regards, Enrique.
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
identity="id"
key-generator="HIGH/LOW">
<map-to table="Range"/>
<field name="id">
<sql name="ID_AUDIENCE" type="integer"/>
</field>
<field name="description">
<bind-xml name="Description"/>
<sql name="DESCRIPTION" type="varchar"/>
</field>
<field name="rangeValues"
type="RangeValues">
<sql many-key="ID_AUDIENCE_RANGE"/>
<!--I don't know have must I put hear-->
<bind-xml name=""/>
<!-- -->
</field>
</class>
<class name="RangeValuesItem"
identity="id"
key-generator="HIGH/LOW"
depends="Audience"
>
<map-to table="RangeValues"/>
<field name="id">
<sql name="ID_RANGE_VALUES" type="integer"/>
</field>
<field name="range">
<bind-xml name="Range" node="text"/>
<sql name="RANGE" type="varchar"/>
</field>
<field name="value">
<bind-xml name="Value" node="text"/>
<sql name="VALUE" type="varchar"/>
</field>
<field name="audience" type="audience">
<sql name="ID_AUDIENCE"/>
</field>
</class>
-----Mensaje original-----
De: pedro canales [mailto:[EMAIL PROTECTED]]
Enviado el: lunes, 11 de noviembre de 2002 15:50
Para: [EMAIL PROTECTED]
Asunto: Re: [castor-dev] can Castor do it???
Enrique,
Could you send me a snippet of code how are you
trying to do this?
If you have succeded marshalling your objetcs, I
think is not a big deal making unmarshalling.
Pedro.
>From: "Arnaud Blandin" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Re: [castor-dev] can Castor do it???
>Date: Mon, 11 Nov 2002 14:18:13 +0100
>
>Hi Enrique,
>
>Why not using the Source Generator to generate the java object model
>from the schema?
>The mapping API intends to provide information mostly on the java model
>you want to marshal to xml and unmarshal from xml. It doesn't define an
>XML grammar by itself (even though it lets you specify some XML
>datatyping). What you are asking for is typically the expression of an
>XML Schema rule thus in that case the solution is to use the Source
>Generator.
>
>Hope that helps,
>
>Arnaud
>
>-----Original Message-----
>From: Enrique Rodr�guez [mailto:[EMAIL PROTECTED]]
>Sent: Monday, November 11, 2002 2:01 PM
>To: [EMAIL PROTECTED]
>Subject: [castor-dev] can Castor do it???
>
>Past week i asked for a solution to my problem. i Have to marshall and
>unmarshall an xml document like this...
>
><Range>
> <RangeQualifier>Description</RangeQualifier>
> <RangePrecision>From</RangePrecision>
> <RangeValue>15</RangeValue>
> <RangePrecision>To</RangePrecision>
> <RangeValue>45</RangeValue>
></AudienceRange>
>RangePrecision and RangeValue always are joined, and as you can see, can
>be repeatable.
>the xml-schema can support this, but "I think", castor not.
>If anybody know how can I do it, PLEASE, help me.
>Now, i can make the unmarshal process with something like that:
> <field name="setValues"
> type="RangePrecisionValue"
> collection="vector"
>
>set-method="addRangePrecisionValue">
> <bind-xml node="element" matches="*"/>
> </field>
>I add some code to the method addRangePrecisionValue. In this method i
>receive all the tags values and create the objects I need. But I don't
>find any clue with the marshall process.
>Regards, Enrique.
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
