Hi all,
Im new to Hibernate- had a conceptual question about many-to-many bidirectional mappings with link tables.I have looked at documentation and also in a couple of books but have been unable to figure something out.
Please consider this situation(from the CaveatEmptor example):
Categories and Items have a many-to-many relationship which is represented in a link table.Collections of either are present in each class using the mapping files as recommended.Now if I wanted to retrieve info from a join of these(with a restriction),
eg: If the link table was not present,I'd have used the following query:
Code:
Select * from category inner join item where category="ABC"
how would I do this without having to map the link table explicitly(that is the solution Ive seen to similar questions on this forum.)Link tables are purely a normalization concept and should not have to be mapped.If all that this table contains is the linking info between these two entities, it should not be a class by itself- its just not object-oriented.
I apologize if this is a trivial issue which has been implied - I have not found an example which spells out how to do this.
Thanks
Anirudh