Let’s say I have a domain object with the following field:
private Map<StatType, Double> maxValues = new HashMap<StatType, Double>();
StatType is an Java enum.
How do I map this using JPA?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Another post that maybe helps: Storing a Map<String,String> using JPA. This solves the intra-table column-to-column mapping. If you really want to store a
Mapin a single column, I guess the only possible solution is to store it as a @Lob. An other SO post that describes this, though, in Hibernate: How to persist a HashMap with hibernate