Hi.
In Hibernate this inheritance-schema works (this is
Scala-code but you get it):
@MappedSuperclass
abstract class AbstractDomainObject {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_STORE")
var id: java.lang.Long = null
}
@Entity
@Table(name = "project")
@SequenceGenerator(name = "SEQ_STORE", sequenceName = "project_id_seq", allocationSize = 1)
class Project extends AbstractDomainObject
But in EL I get this exception:
Exception Description: Conflicting annotations with the
same name [SEQ_STORE] were found. The first one
[@javax.persistence.SequenceGenerator({sequenceName=rpm_user_id_seq,
name=SEQ_STORE, allocationSize=1})] was found within [class
no.officenet.example.rpm.support.domain.model.entities.User]
and the second
[@javax.persistence.SequenceGenerator({sequenceName=project_id_seq,
name=SEQ_STORE, allocationSize=1})] was found within [class
no.officenet.example.rpm.projectmgmt.domain.model.entities.Project].
Named annotations must be unique across the persistence
unit.
The thing is that I have lots of entities inheriting from my
AbstractDomainObject, which defines the @Id, but the sequence to
use is defined in the child-entities because it's
table-specific. I'd rather not define the @Id in all my
child-entities.
Is there a way to accomplish this in EL?
Thanks.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users