JPA doesn't provide for a Map with the key being an Entity and the value being a non-Entity. JDO supports that FWIW.
class uses a non-entity [class java.lang.Boolean] in HashMap?
문제
I want to have the following field in my Presentation class (JPA entity):
private HashMap<User, Boolean> users = new HashMap();
but when I run our databasetest (fill db with testdata), I get the following errormessage:
[class domein.Presentation] uses a non-entity [class java.lang.Boolean]
as target entity in the relationship attribute [field users].
I have tried using the annotations @ElementCollection
and @BasicMap
but they both don't work. My current solution is to make a new Entity class MyBoolean
, but that is ugly code. How can I do this?
해결책
제휴하지 않습니다 StackOverflow