Hi Amit,

sorry for the late response.

Amit Basu wrote:

> I get com.thoughtworks.xstream.mapper.CannotResolveClassException:
> comparator in
> 
com.thoughtworks.xstream.converters.collections.TreeSetConverter.unmarshal(TreeSetConverter.java:86)
> I am using a SortedSet with TreeSet impl and hibernate mapping file has
> <set name ="groups" .... table="..."  sort="com....MyComparator", etc to
> me, it seems XStream's TreeSetConverter is not getting my comparator class
> from the hbm.xml, and complaints that "comparator" class is not there. If
> I switch to Set and HashSet, there is no issue, but then I'd have to
> implement the sorting at a higher layer.

I am not sure what you try to accomplish. Any Hibernate support in XStream 
is one-way only i.e. you can marshal a Hibernate PersistentSortedSet and you 
will get a TreeSet at unmarshalling time.

Note, that I have absolutely no Hibernate experience, so I don't know what 
you can do with the Hibernate mapping files. All test code in Xstream was 
provided by helpful users.

As far as XStream is concerned, the PersistentSortedSet is handled by the 
HibernateSortedSetConverter which is derived from the TreeSetConverter. That 
one will marshal also the comparator that is returned by 
SortedSet.comparator().

So how does the XML for this comparator looks like that has been produced by 
XStream? What do you exactly mean with "complaints"?

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to