Hibernate 可以识别实体而不声明为 @Entity 或在 xml 配置中吗?
class MyEntity {
Long id;
}
interface MyEntityRepository implements Repository<Entity, Long> {
}
最佳答案
不,如果您没有在较新的 Hibernate 版本中使用正确的注释声明实体或在 XML 中声明它们,则 Hibernate 框架无法将该类识别为实体。
关于java - 没有@Entity的 hibernate 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40650402/