Hello,
I am running into this exception : Persistent class has non-persistent superclass: java.util.HashMap
Here is my class declaration :
public class foo extends HashMap<foo1, foo2[]> { }
From the PersistentProxy documentation looks like it is not allowed : " A proxied class may not be used as a superclass for a persistent class or entity class"
@Persistent(proxyFor = HashMap.class)
public class PersistentProxyForHashMap implements PersistentProxy<HashMap<foo1,foo2[]>> {
foo1 Key;
foo2[] Value;
private PersistentProxyForHashMap() {}
@Override
public HashMap<foo1,foo2[]> convertProxy() {
HashMap<foo1,foo2[]> h1 = new HashMap<foo1,foo2[]>();
h1.put(Key, Value);
return h1;
}
@Override
public void initializeProxy(HashMap<foo1,foo2[]> arg0) {
Key = (foo1) arg0.keySet();
Value = arg0.get(Key);
}
}
How can I workaround this restriction ?
Also, I have read that built-in proxy class is available for HashMap. How can i use that ?
Thanks,
Neel