I am trying to code a many to many relationship between two entities. One of my entity is named View and the other is Column.
I am trying to use the @JoinTable annotation and for the table property in the annotation I am specifying a table column_view (which I have created in the database).
My associative table has other fields, apart from the primary key of view and column entities. This makes me feel that my current way of using @JoinTable would not work under this condition and I have to create two onetomany mappings like
Column -> OnetoMany -> ColumnView <- OnetoMany <- View.
Am I right in my approach or is there anyother way out to represent such manytomany relationships.
Yes, as far as I kow you are absolutely right. Use the two one to many relationships and see your relationship table as a table in its own right. That is because of the extra fields.