I have a social networking app and a Subscription table/entity and User table/entity. I want to map a many to one relationship from Subscription to User but am not sure how best to capture the relation. Read up on this link on JPA Relationships
Here is my code so far Link to gist code there seems to be something wrong with my annotations.
I have a User table/entity with a user_id and name. My Subscription table has a subscriber(User) and a publisher(User) and an embedded composite key. How do you map the relation and then access the table/entity so I can add or remove subscriptions?