How will you map the columns of a DB table to the properties of a Java class in Hibernate?

We can map the class properties and table columns by using one of the two ways:

  • XML: We can map the column of a table to the property of a class in XML file. It is generally with extension hbm.xml
  • Annotation: We can also use annotations @Entity and @Table to map a column to the property of a class.

Leave a Reply

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