Heya Harjit,
I've looked at the 'location' attribute, but I'm not sure how it'll help
me. Check out the sample map below for the classes in the question.
The areas with the question mars are the places that are confounding me
right now. I don't know what to bind Bar to since it has multiple
properties and the XML isn't broken up with child elements.
Do you have any ideas?
Thanks,
g
<mapping>
<class name="foo" auto-complete="false">
<map-to xml="foo"/>
<field name="oneThing"
type="string"
required="false" direct="false" transient="false"
get-method="getOneThing" set-method="setOneThing">
<bind-xml name="element_one" node="element"
reference="false"/>
</field>
<field name="moreStuff"
type="Bar"
required="false" direct="false" transient="false"
get-method="getMoreStuff" set-method="setMoreStuff">
<bind-xml name="???????" node="???????" reference="false"/>
</field>
</class>
<class name="bar" auto-complete="false">
<map-to xml="??????????"/>
<field name="anotherThing"
type="string"
required="false" direct="false" transient="false"
get-method="getAnotherThing" set-method="setAnotherThing">
<bind-xml name="element_three" node="element"
reference="false"/>
</field>
<field name="moreThings"
type="string"
required="false" direct="false" transient="false"
get-method="getMoreThings" set-method="setMoreThings">
<bind-xml name="element_five" node="element"
reference="false"/>
</field>
</class>
</mapping>
-----Original Message-----
From: Singh, Harjit [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 26, 2007 1:54 PM
To: [email protected]
Subject: RE: [castor-user] Mapping contained classes in a single element
Take a look at the location attribute.Let me know if that works or no
Thanks
- Harjit
-----Original Message-----
From: Garret Schweitzer [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 26, 2007 12:15 PM
To: [email protected]
Subject: [castor-user] Mapping contained classes in a single element
All,
I have an XML with a structure that might look like so:
<foo>
<element_one>something</element_one>
<element_two>something else</element_two>
<element_three>another thing</element_three>
<element_four>more stuff</element_four>
<element_five>even more stuff</element_five> </foo>
And a class structure like so:
Public class Foo
{
private String onething;
private Bar moreStuff;
public void SetOneThing (String one)
...
public String GetOneThing()
....
public void SetMoreStuff (Bar bar);
...
public Bar GetMoreStuff();
...
}
Public class Bar
{
private String anotherThing;
private String moreThings;
...
}
So, here's the question: Can I map the XML above... And it's flat, so
that it'll create a Foo and fill it?
I'm not sure how to map/bind the Bar in the map.
Thanks,
g
Garret Schweitzer
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
This email, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this email is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this email is
prohibited. If you have received this email in error, please notify the
sender by replying to this message and delete this email immediately.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email