What is Hibernate mapping file?

  • Hibernate mapping file is used to map java object to the database table.
  • We can have any number of mapping files in a project.
  • Each hibernate mapping file must contain only one <id> tag (or relevant tag <composite-id>)
  • <id> tag corresponds to either primary key or Non primary key. Hibernate need unique key to map
  • Class names and property names are case sensitive in mapping file.
  • Table names and column names are not case sensitive in mapping file.
  • If we don’t give <column> tag, then property name will be column name.
  • If we don’t give table name, then class name will be the table name.

Posted in hibernate and tagged , , .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.