title: how to resolve , Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements
body: <p>i am trying to map the below UserRolesActivity model to Activity model which has OneToMany relationship to it. I don't know where i am doing it wrong even when the annotations i have used are correct. Can someone please help ?</p>
  <pre><code>@Entity
  @Table(name = &quot;user_roles_activity&quot;)
  public class UserRolesActivity {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      @Column(name = &quot;user_id&quot;)
      private Long userId;
  
      @Column(name = &quot;role_id&quot;)
      private Long roleId;
  
      @OneToMany
      @JoinTable(name = &quot;user_role_activities_mapping&quot;, joinColumns = @JoinColumn(name = &quot;user_roles_id&quot;), inverseJoinColumns = @JoinColumn(name = &quot;activity_id&quot;))
      private Activity activity;
  
  }
  </code></pre>
  <pre><code>@Entity
  @Table(name = &quot;activities&quot;)
  public class Activity {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      @Column(name = &quot;name&quot;)
      private String name;
  
  }
  
  </code></pre>