我有这对于一些原因(Why should anybody put annotations on the getters or setters when using JPA to map the classes?)我们注释getter方法,而不是该领域的实体:JaVers异常,当@Id是消气,而不是对房地产
protected Long id;
...
@Id
@GeneratedValue(...)
@SequenceGenerator(...)
@Column(name = "id")
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
致电时:
javers.findChanges(QueryBuilder.byInstanceId(5, MyModel.class).build())
JaVers抛出以下异常:
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.
是否支持ED?
你的字段和属性混合的注解? –
没有我不混合注释。所有注释都在getter方法 – patri
然后我想JaVers不支持这个...你可能想要注册一个问题。 –