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.
如何在运行时检查 Hibernate 为对象映射设置的内容?
我有一个没有产生任何错误的映射,它在休眠配置中,但尚未找到。我想检查映射以验证它是否存在并检查拼写错误。
您可以使用SessionFactory.getAllClassMetadata()获取所有实体的元数据。