How can the mapping files be configured in Hibernate?
-
Mapping files can be added to Configuration in the application code
-
They can be configured in hibernate.cfg.xml using the <mapping> elements
-
Both a and b
-
None of the above
Reveal answer
Fill a bubble to check yourself
C
Correct answer
Explanation
Hibernate mapping files can be configured either programmatically by adding them to the Configuration object in code, or declaratively in hibernate.cfg.xml using elements. Both approaches are valid and often both are used together.
AI explanation
Hibernate mapping metadata can be supplied in more than one way: mapping resources can be explicitly added to the Configuration object in application code, or they can be declared using `elements insidehibernate.cfg.xml`, and both approaches can be combined in the same application.