¿Por qué eclipselink 2.5.0 no admite Override TableGenerator o SequenceGenerator en subclases mientras que Hiberate sí lo admite?

Como titulado.

Isn't it common to share Id definition in a base entity class? such as following:

@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; }

    ...

}

While in subclass it is suppose to work as following:

@Entity
@Table(name = "sub_entity_table")
@TableGenerator(name = "SUB_ENTITY_SEQUENCE", initialValue = 1, allocationSize = 100)
public class SubEntity extends BaseEntity {
    ...
}

Since the GeneratedValue.generator is not specified, then the default value should be specified. The default generator name would be: a. The nearest upward TableGenerator definition from the entity class, just like inheritance. b. If situation in "a" does not exist, then use the literal value provided by JPA provider, such as SEQ_GEN_TABLE.

I love eclipseLink so much. I really hope to see this feature included in the next eclipselink release. :)

preguntado el 22 de septiembre de 13 a las 12:09

Have the same problem using EclipseLink 2.5.2. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.