我的课看起来像
@Entity
public class Version extends MutableEntity {
@Column(nullable = false)
private String name;
@Column(nullable = false)
@Enumerated(EnumType.STRING)
private VersionType type;
@Column(nullable = false)
@Enumerated(EnumType.STRING)
private VersionStatus status;
@Column(nullable = true)
private DateTime publishedOn;
@Column(nullable = true)
private DateTime retiredOn;
@Column
private Version parentVersion;
我想要一个parentVersion
与 相同的类型Version
,但我的测试失败了
@Test
public void testVersion() {
Version version = new Version("testVersion", VersionType.MAJOR);
version = crudService.create(version);
assertNotNull(version.getId());
}
我看到错误为
Caused by: org.hibernate.MappingException: Could not determine type for: com.myorg.project.versioning.entities.Version, at table: Version, for columns: [org.hibernate.mapping.Column(parentVersion)]
我该如何解决这个问题?