Hibernate - does it change the structure of a database?

后端 未结 3 910
时光取名叫无心
时光取名叫无心 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:30

    Hibernate is a highly mature project and definitely works well with existing schemas. You can even generate your class entities from an existing schema with Hibernate tools.

    Still there is an important point where you need be careful: Hibernate supports composite primary and foreign keys but you'll have a much easier life with technical generated ids.

    If I had a schema with composite primary keys forming natural ids I would consider replacing them with technical auto generated ids before using Hibernate.

提交回复
热议问题