Hibernate 5.2 get natural id properties from metamodel
问题 Since SessionFactory#getClassMetadata(java.lang.Class) was deprecated, I am not able to use ClassMetadata. I would like to access to the following methods: org.hibernate.metadata.ClassMetadata#getNaturalIdentifierProperties org.hibernate.metadata.ClassMetadata#hasNaturalIdentifier According to the documentation, I should replace getClassMetada with EntityManagerFactory.getMetamodel(). However, the metamodel does not contain methods to get natural-id. I am using xml mapping for natural-id and