0
所以,我有一个自定义的ID的模式,是这样的:播放1.2.5 - 用自定义的ID加载初始数据
@Entity
public class SomeModel extends Model {
@Id
@Unique
@Required
public String myOwnId;
@Required
public String someOtherField;
public SomeModel(final String myOwnId, final String someOtherField) {
this.myOwnId = myOwnId;
this.someOtherField = someOtherField;
}
}
而且我有一个是这样的一个初始data.yml文件:
SomeModel(myModel):
myOwnId: "someID"
someOtherField: "some value here"
但是,这不起作用:RuntimeException occured : Cannot load fixture initial-data.yml: org.hibernate.PropertyAccessException: could not set a field value by reflection setter of models.SomeModel.id
。任何漂亮和简单的解决方案呢?