Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
hql 的休眠(我使用的是 3.4 版)文档说它支持接口,但我无法让它工作。我有一些持久类(不是从彼此继承,而是共享许多功能),它们都共享一个接口(CategorizableEntity)。我可以在我的 java 代码中将它与 instanceof 一起使用,但我无法查询它(“来自 CategorizableEntity”)。
我用@Entity 对其进行了注释,但是休眠不会让我像其他人一样映射它。这可能吗?有没有我找不到的特殊方法来映射它?
谢谢!约书亚
尝试使用接口的全名(例如:java.util.Set 而不是 Set)