Hi Hervé,
The binding tutorial published with RC1 is unfortunately out of date on
this. I have a newer version of the tutorial that covers it in more
depth, and will be including that in RC2.
To do what you want you just use a <collection> element directly:
<collection field="orders">
<value name="order"/>
</collection>
- Dennis
Hervé Bitteur wrote:
Hello,
I would appreciate some help regarding the use of arrays of primitive
types.
I've browsed the documentation, it says that arrays of primitive types
are supported.
The question is : what is the proper syntax to describe the mapping ?
Let me take example13 from the tutorial folder found in the distribution.
It contains a Customer class as follows:
public class Customer {
[... other fields omitted for clarity]
private int[] orders;
}
The mapping is defined by using custom methods to (de)serialize an
array of int
And the data format is something like the following :
<customer>
[... other lines omitted for clarity]
<orders>2393901 3119013 3221010 4390901 6501931</orders>
</customer>
This is not precisely what I'm looking for.
I consider int[] (or double[], or whatever primitive array) as a kind
of collection, and I would expect to be able to store (and retrieve)
using the following format :
<customer>
[... other lines omitted for clarity]
<order>2393901</order>
<order>3119013</order>
<order>3221010</order>
<order>4390901</order>
<order>6501931</order>
</customer>
This would be very similar to, say, an ArrayList of Integer, except
that the Java code would be using int[]. Something I need for
efficient computing later on.
Anyone has a suggestion on this :
1/ Is this mapping feasible ?
2/ How do I define it ?
I've tried several definitions like :
<collection field="orders" type="int[]" />
<collection name="order" item-type="int" />
<collection name="order" field="orders" item-type="int" />
<collection item-name="order" field="orders" item-type="int" />
<collection item-name="order" field="orders" type="int[]" /> (I like
this one, even though item-name is not recognized !)
But to no avail so far...
Thanks for any help
/Hervé
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users