eclipse Duplicate generator named “ID_GENERATOR” defined in this persistence unit

前端 未结 3 830
天涯浪人
天涯浪人 2021-01-18 08:25

I\'m currently having this issue which I don\'t have before I migrated to eclipse-jee-kepler. What I have:

I have 2 classes, base and the extending class:

         


        
3条回答
  •  忘掉有多难
    2021-01-18 08:38

    The generator's name must to be unique by generator and it can be referenced by one or more classes.

    The javadoc clearly says:

    (Required) A unique generator name that can be referenced by one or more classes to be the generator for primary key values.

    According to the java JPA 2.1 specification (SequenceGenerator Annotation of the JPA 2.1 - section 11.1.48):

    The scope of the generator name is global to the persistence unit (across all generator types)

提交回复
热议问题