Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jpa 为什么eclipselink 2.5.0不支持子类中的Override TableGenerator或SequenceGenerator,而Hibrate支持?_Jpa_Eclipselink - Fatal编程技术网

Jpa 为什么eclipselink 2.5.0不支持子类中的Override TableGenerator或SequenceGenerator,而Hibrate支持?

Jpa 为什么eclipselink 2.5.0不支持子类中的Override TableGenerator或SequenceGenerator,而Hibrate支持?,jpa,eclipselink,Jpa,Eclipselink,如标题所示 在基本实体类中共享Id定义不是很常见吗?例如: @MappedSuperclass public abstract class BaseEntity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.TABLE) private Long id; public Long getId() {return this.id;} public void s

如标题所示

在基本实体类中共享Id定义不是很常见吗?例如:

@MappedSuperclass
public abstract class BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE)
    private Long id;

    public Long getId() {return this.id;}
    public void setId(Long id) { this.id = id; }

    ...

}
在子类中,假设其工作如下:

@Entity
@Table(name = "sub_entity_table")
@TableGenerator(name = "SUB_ENTITY_SEQUENCE", initialValue = 1, allocationSize = 100)
public class SubEntity extends BaseEntity {
    ...
}
由于未指定GeneratedValue.generator,因此应指定默认值。默认生成器名称为: A.实体类中最接近的向上TableGenerator定义,就像继承一样。 B如果“a”中的情况不存在,则使用JPA提供者提供的文本值,如SEQ_GEN_TABLE


我非常喜欢日食。我真的希望在下一个eclipselink版本中包含此功能。:)

使用EclipseLink 2.5.2时也会遇到同样的问题。