When to use DiscriminatorValue annotation in hibernate

后端 未结 4 1020
不知归路
不知归路 2020-12-05 06:29

What and when is the best scenario to use DiscriminatorValue annotation in hibernate?

4条回答
  •  攒了一身酷
    2020-12-05 06:50

    When you have an entity inheritance using the single table strategy, and you want the value of the discriminator column to be something other than the name of the class of the entity concrete class, or when the type of the discriminator column is not STRING.

    This is explained, with an example, in the javadoc.

提交回复
热议问题