Hibernate - does it change the structure of a database?

后端 未结 3 954
时光取名叫无心
时光取名叫无心 2021-01-16 11:08

I\'m building bigger project in java on Spring and lot of people have adviced me, to use hibernate to ease access to the database. The problem is,that I have to use database

3条回答
  •  感动是毒
    2021-01-16 11:29

    While Hibernate can be used to create / delete tables, typically you wouldn't do that in a production environment. In these scenarios, you're defining the Object-Relational Mapping between the POJOS and the underlying database schema. So, really, Hibernate doesn't need to add anything to the database schema.

    If you're working with a Schema which was defined before applying hibernate, you probably need to ensure the field converters are appropriate (ie, Hibernate might have different ideas about what column type in SQL constitutes a date or a number), but that means that you would have to provide the explicit mapping/converter instead of using the default.

    But, you should be able to use Hibernate without making any major changes to the existing database schema.

提交回复
热议问题