Prereading:
How to save a HashMap using sleep mode
My problem rotates the following structure that I want to map to JPA:
Map<User, List<POJO>>
My POJO is very simple (no compound types, etc., only some primitives).
How can I implement advice in a related question? How can I comment only on the List part using @Lob (When I just comment on the field, I get a class cast error because the HashMap cannot be attributed to Blob, which is the root of my problem - it annotates only the values โโof the map part)?
I'm not sure if I need to create a wrapper type that implements Serializable that wraps a List, or enough to just use an ArrayList, which itself is Serializable. And in any case, I canโt save this copy of the map ...
By the way, I am open to advice on this in different ways: I could just hold List as a member of the class for each user, although I donโt feel that it belongs there because it is not user data (like account data, name, address, etc.). It is similar to purchases, so I put them in a class similar to a utility (external to the User class) that deals with these purchases in order to have more modular models. I would like to hear advice on whether this sounds reasonable.
Any useful tips will be rewarded with imaginary cookies (and vice versa, obviously).
They are fat-free in a very imaginary sense.
Greetings.
davin source share