Difference between Hibernate mapping file and annotation

后端 未结 6 1275
小蘑菇
小蘑菇 2020-12-16 06:08

Today I was trying to create a application using Hibernate as ORM. So while creating I had a doubt. What is the best practice to use, Hibernate mapping file (.hbm file) or a

6条回答
  •  死守一世寂寞
    2020-12-16 06:39

    Annotations are developed with java language and java developer easy to learn when compared with XML. And one more point in real time table names and column names are fixed 99%, so no need to change java code also but if you want to change table names and column names frequently you will move with XML finally cfg.xml file is manadatary because database may change.

提交回复
热议问题