Issues

Select view

Select search mode

 
50 of

overriding @Id generation declared by @MappedSuperclass

Description

Consider the following code:

@MappedSuperclass public class A { private Long id; @Id @GeneratedValue(generator = "a_sequence") @SequenceGenerator(name = "a_sequence", sequenceName = "a_sequence") public Long getId() { return id; } public void setId(Long id) { this.id = id; } }
@Entity public class B extends A { private Long id; @Id @GeneratedValue(generator = "b_sequence") @SequenceGenerator(name = "b_sequence", sequenceName = "b_sequence") @Override public Long getId() { return id; } @Override public void setId(Long id) { this.id = id; } }

Either:

  1. the code should work as intended, and B ids should be assigned by b_sequence, or

  2. the code should be rejected and a meaningful error should be reported.

Details

Assignee

Reporter

Components

Priority

Created 7 hours ago
Updated 7 hours ago

Activity

Show: