Why are composite keys discouraged in hibernate?

前端 未结 5 554
栀梦
栀梦 2020-12-12 13:50

This is from Hibernate official tutorial:

There is an alternative declaration that allows access to legacy data with

5条回答
  •  爱一瞬间的悲伤
    2020-12-12 14:11

    If Hibernate documentation is properly understood:

    "There is an alternative declaration that Allows access to legacy data with composite keys. Its use is strongly discouraged for anything else."

    on topic 5.1.4. id tag xml which enables the primary key mapping made too soon we can conclude that the hibernate documentation discourages the use of instead of xml tag for composite primary key mapping and NOT make any reference negative to use composite primary keys.

提交回复
热议问题