我试图映射这三个类:
@Entity
class Photo {
...
@ManyToOne
private Map<User, Coordinate> labelledIn;
...
}
@Entity
class User {
...
@OneToMany (mappedBy ="labelledIn")
private Set<Photo> labelledPhotos;
...
}
@Embedded
class Coordinate { ... }
我收到了这个错误:
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.redex.model.Photo.labelledIn references an unknown entity: java.util.Map
我可以在我的数据库中映射这个合格的关联吗?如果我不能,我该如何以不同的方式做到这一点?