org.hibernate.MappingException: An association from the table ADDRESS refers to an unmapped class: model.User
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1824)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1756)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1423)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1856)
at util.SessionUtil.<clinit>(SessionUtil.java:10)
... 1 more
Reason:
Mapping for a non existent field is there in the mapping xml. I have an Address class. It has one-to-one relationship between User class. Later I delete the association from Address class, but forgot to delete the mapping from xml.
Solution:
1. Remove the unwanted property mapping element
2. Add the correct property back to the class.
No comments:
Post a Comment