I have two tables.
-- child
id key (VARCHAR, UNIQUE)
----------------------------------
0 'a'
1 'b'
-- parent
id child_keys (JSON)
------------------------------
0 ["a", "b"]
Ho can I map the child_keys column into a List or Map of Child?
class Parent {
// works
@JdbcTypeCode(SqlTypes.JSON)
@Column(name = "child_keys")
List<String> childKeys;
// how can I do this?
// Child(0,"a"), Child(1,"b")
List<Child> children;
// or this?
// "a"-Child(0,"a"), "b"-Child(1, "b")
Map<String, Child> children;
}