Which of the following association needs tag element in mapping file?
-
One to one
-
One to many
-
Many to one
-
None of the above
The element in Hibernate mapping is used for collections requiring key-value pair semantics, typically for one-to-many or many-to-many associations where the collection needs to be indexed. While , , and can also map one-to-many relationships, is specifically designed when you need to maintain index-based access to the collection elements.
In Hibernate mapping files, the element is used to map a Java `Map`-typed collection property, which is the standard way to represent a keyed one-to-many association (each key maps to one related child entity). One-to-one and many-to-one associations are instead mapped with and elements, which don't need the collection wrapper.