在hibernate中@Any注解用于定义一对一的关联,它可以指向几种实体类型中的一种。 JPA 中是否有等同于@Any 注释的内容?
最佳答案
正如文档所说:
This is not the usual way of mapping polymorphic associations and you should use this only in special cases (e.g. audit logs, user session data, etc).
所以通常不需要这样的关联,可以用普通的JPA继承来解决。这就是为什么它不是 JPA 规范的一部分。
关于java - JPA 中的@Any 等价于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55746074/