How do I override the GenerationType strategy using Hibernate/JPA annotations?

后端 未结 4 1044
野性不改
野性不改 2020-12-29 10:50

I\'m considering using Annotations to define my Hibernate mappings but have run into a problem: I want to use a base entity class to define common fields (including the ID

4条回答
  •  甜味超标
    2020-12-29 11:12

    If you put your annotations on the getter rather than the field, when you override the method in the subclass, the annotations placed there will be used rather than the ones in the superclass.

提交回复
热议问题