Multiple choice technology programming languages

How can the mapping files be configured in Hibernate?

  1. Mapping files can be added to Configuration in the application code

  2. They can be configured in hibernate.cfg.xml using the <mapping> elements

  3. Both a and b

  4. 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.