C
C
click_f2017-04-20 20:34:47
Java
click_f, 2017-04-20 20:34:47

How to map a Map< String, ArrayList> object in hibernate?

There is Map<String, ArrayList<String>> data;an object which is inside @Entity .
It is required to map only ArrayList<String>in the database, i.e. only data.entrySet().
As a result, you need to get a table consisting only of ArrayList.
Is it possible to do this without creating an additional variable?
How to do it with annotations?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-04-20
@click_f

No way. Marshaling is always symmetrical. If it were possible to discard the mapping keys when saving the entity to the database, then where would they come from when restoring the entity from the database?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question