I have an Entity which for a number of reasons (Why should anybody put annotations on the getters or setters when using JPA to map the classes?) we are annotating the getter method instead of the field:
protected Long id;
...
@Id
@GeneratedValue(...)
@SequenceGenerator(...)
@Column(name = "id")
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
When calling:
javers.findChanges(QueryBuilder.byInstanceId(5, MyModel.class).build())
JaVers is throwing the following exception:
JaversException: ENTITY_WITHOUT_ID Class 'com.myproject.model.MyModel' mapped as Entity has no Id property. Use @Id annotation to mark unique and not-null Entity identifier.
Is it supported?