That’s not possible. A @OneToMany/@ManyToMany must by definition be a Collection or Map. If you want to store information in the join table, make it an entity e.g.
No, I don’t want a join table. I just wanted to encapsulate the collection into a discreet class (which is a subclass of a collection, no?) so I could some further custom actions for the collection (like finding the one that’s marked primary or of type X). In this case, I’ll add the getter that returns the discreet class pre-populated with the collection if there are any entries (no need to delete/insert/update from the class).
In this case, I’ll add the getter that returns the discreet class pre-populated with the collection if there are any entries (no need to delete/insert/update from the class).