Question

How should I use EclipseLink's @BasicMap annotation for a map whose key value is an entity and the value is an Integer?


@Entity
class A {

   // This doesn't work, as the key is an entity
   @BasicMap
   private Map<B, Integer> myMap = new HashMap<B, Integer>();

}

@Entity
class B {
 ...
}

Was it helpful?

Solution

I found out that this is not possible, as BasicMap only works for primary datatypes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top