How to use @BasicMap for a HashMap whose key values are entities
-
11-09-2019 - |
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 {
...
}
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