I'm running a fairly simple region. Or I thought I was...
Key is a Long.
Value is a custom class. Inside value class is a few member variables and a set of attributes modelled as a TreeSet (which is there for ordering).
There are a half dozen possible attributes, each subclassed from a common root. Each implements Comparable<Root>.
Region is PDX serialized.
I implement PdxSerializable in ~all~ the classes that can be in the value.
Regular gets and puts work fine. Region loads fine. All looks good until I start with the OQL....
When I try to execute a query such as the one below (using spring-data and a GemfireTemplate) I'm getting a ClassCastException server side.
Debugging has me in the TreeMap.put<K,V) code @542 - Comparable<? super K> k = (Comparable<? super K>) key;
The query is not complicated: SELECT DISTINCT a.value FROM /(myregion).entries a WHERE a.key = $1; Here $1 is just 1L.
My question(s):
Is there some strangeness with TreeSet and PDX I don't know about?
Or did I misunderstand something?
If so can anyone help me see what?
If not and it is a limitation, is there a workaround?
Clearly this is something silly, but I'm not a PDX expert so I'm not sure what I missed.
Any ideas anyone?