rantav/hector — Issue #327: @AnonymousPropertyHandling doesn't allow for KEY other than String
Author: lc-nyovchev
Created: 2011-11-04 16:20:18+00:00
State: open

I have an anonymous property, that I want to sort, kinda like this:

@Entity
@Table(name ="Foo")
@CassandraComparator(type = ComparatorType.UUIDTYPE) //custom annotation will set the comparator to UUIDTYPE
@AnonymousPropertyHandling(type = String.class, serializer = StringSerializer.class, adder = "addAnonymousProp", getter = "getAnonymousProps")
public class Foo implements Serializable {
@Id
private String someId;

private Map anonymousProps = new LinkedHashMap();
public void addAnonymousProp(UUID name, String value) {
anonymousProps.put(name, value);
}
....
}

Since the new version I can specify any class as the VALUE, which is quite good. However, when I want to sort the anonymous properties by their UUID, because they are created by TimeUUIDUtils. I get this one upon initizlization:

me.prettyprint.hom.cache.HectorObjectMapperException: Could not find anonymous add handler for class, class foo.bar.Foo, with anonymous value type, class java.lang.String.

Am I missing something? If what I want to achieve is not possible, how do you sort your anonymous props by something other than String?