Ошибка "Свойство не найдено" в модели, производной от ebean - PullRequest
1 голос
/ 07 августа 2020

У меня очень простая модель Ebean:

@MappedSuperclass
public abstract class BaseEntity extends Model {

  @Id @GeneratedValue(strategy = IDENTITY)
  public int id;

  @WhenCreated
  @Column(name = "createdAt")
  public ZonedDateTime createdAt;

  @WhenModified
  @Column(name = "updatedAt")
  public ZonedDateTime updatedAt;
}

@Entity
@Table(name = "person")
@AttributeOverride(name = "id", column = @Column(name = "person_id"))
public class PersonEntity extends BaseEntity {

  @Column(name = "name")
  String name;

  @Column(name = "address")
  String address;
}

Но когда я попытался запустить приложение, я получил ошибку:

java.lang.IllegalStateException: If you are running in an IDE with enhancement plugin try a Build -> Rebuild Project to recompile and enhance all entity beans. Error - property createdAt not found in [name, address, id] for type class PersonEntity

Я искал в Интернете учебник по ebean, https://ebean.io/docs/intro/first-entity/mapped-superclass. И я считаю, что сделал то же, что и в руководстве. Может ли кто-нибудь помочь мне в этом вопросе?

...