Hi all,
I'm looking for a possibility to store a HashMap.
Code:
Map<AnotherObject, Double[][]>
In order to store Double[][] Arrays I created a usertype which converts the array into a binary format. This works for single objects perfectly (I'm using the @Type(type="...") annotation) like:
Code:
@TypeDefs({
@TypeDef(name="Matrix", typeClass = MyDoubleArray.class),
})
public class Test {
@Type(type="Matrix")
private Double[][] test; // This works!
Does anybody know how to do the same with a HashMap? I would like to define the targetClass as "MyMatrix". But I found the ElementCollection annotation only accepting "*.class" values.
Code:
@ElementCollection(targetClass=???)
@MapKeyClass(value=org.myorg.AnotherObject.class)
Map<AnotherObject, Double[][]> testMap = new HashMap<AnotherObject, Double[][]>();
Thanks for helping!