views:

313

answers:

1

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 {
 ...
}

A: 

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

Kim L