I have table foo, identified by fooId, and table bar which contains a json list of fooIds.
Example of foo:
foo1,"Some random description"
Example of bar:
bar1,["foo1", "foo2"]
Example of bar entity joined via list of fooIds:
bar1,[{"fooId" : "foo1", "description": "Some random description"}, ...]
I want to perform a join such that when I get bar1, I get the foo object as well.
I have a converter class which deserializes the JSON blob and correctly gives me the ids. However, I’m unable to loop that in with a @ManyToMany
or @JoinTable
annotation. I’ve also tried @JsonManagedReference
.
How can I do a join on a json list of identifiers? Thanks.